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

pull/7/merge
Mark McDowall 14 years ago
parent 8c372e938c
commit 0babb9474e

@ -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>

@ -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)

Loading…
Cancel
Save