1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-27 10:17:47 +00:00

Added Javascript to support shift-clicking ranges to disable/enable checkboxes.

This commit is contained in:
Mark McDowall 2011-05-16 16:57:02 -07:00
parent 8c372e938c
commit 0babb9474e
2 changed files with 26 additions and 2 deletions

View file

@ -45,3 +45,27 @@
</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>

View file

@ -6,7 +6,7 @@
{
<fieldset style="display: inline; border-color: lightgrey; width: 26%; margin-bottom: 2px; padding-bottom: 1px; padding-top: 1px;">
@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.SeasonNumber)