diff --git a/core/misc/form.js b/core/misc/form.js index b1d1fff..31c66d7 100644 --- a/core/misc/form.js +++ b/core/misc/form.js @@ -11,6 +11,31 @@ }; /** + * Java Script for Add shift based selection on modules list check box. + */ + $.fn.shiftClick = function () { + var lastSelected; + var checkBoxes = $(this); + this.each(function () { + $(this).click(function (ev) { + if (ev.shiftKey) { + var last = checkBoxes.index(lastSelected); + var first = checkBoxes.index(this); + var start = Math.min(first, last); + var end = Math.max(first, last); + var chk = lastSelected.checked; + for (var i = start; i <= end; i++) { + checkBoxes[i].checked = chk; + } + } else { + lastSelected = this; + } + }) + }); +}; +$('.checkbox .form-checkbox').shiftClick(); + + /** * Sets the summary for all matched elements. * * @param callback