mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-28 02:37:40 +00:00
Added Javascript to support shift-clicking ranges to disable/enable checkboxes.
This commit is contained in:
parent
8c372e938c
commit
0babb9474e
2 changed files with 26 additions and 2 deletions
|
@ -45,3 +45,27 @@
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var lastChecked = null;
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('.chkbox').click(function (event) {
|
||||||
|
if (!lastChecked) {
|
||||||
|
lastChecked = this;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.shiftKey) {
|
||||||
|
var start = $('.chkbox').index(this);
|
||||||
|
var end = $('.chkbox').index(lastChecked);
|
||||||
|
|
||||||
|
for (i = Math.min(start, end); i <= Math.max(start, end); i++) {
|
||||||
|
$('.chkbox')[i].checked = lastChecked.checked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lastChecked = this;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{
|
{
|
||||||
<fieldset style="display: inline; border-color: lightgrey; width: 26%; margin-bottom: 2px; padding-bottom: 1px; padding-top: 1px;">
|
<fieldset style="display: inline; border-color: lightgrey; width: 26%; margin-bottom: 2px; padding-bottom: 1px; padding-top: 1px;">
|
||||||
@Html.DisplayFor(m => m.SeasonString)
|
@Html.DisplayFor(m => m.SeasonString)
|
||||||
<span style="float: right;">@Html.CheckBoxFor(m => m.Monitored)</span>
|
<span style="float: right;">@Html.CheckBoxFor(m => m.Monitored, new { @class = "chkbox" })</span>
|
||||||
|
|
||||||
@Html.HiddenFor(m => m.SeasonId)
|
@Html.HiddenFor(m => m.SeasonId)
|
||||||
@Html.HiddenFor(m => m.SeasonNumber)
|
@Html.HiddenFor(m => m.SeasonNumber)
|
||||||
|
|
Loading…
Reference in a new issue