summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2020-11-17 20:14:55 +0100
committerJannik Schönartz2020-11-17 20:14:55 +0100
commit385146bd844683d0c12b358fee954d414ed88ba1 (patch)
tree32c23fd2e20fc06aae7820ff6b41c474f749dac7
parent[sysconfig] Dynamically update warnings button (diff)
downloadslx-admin-385146bd844683d0c12b358fee954d414ed88ba1.tar.gz
slx-admin-385146bd844683d0c12b358fee954d414ed88ba1.tar.xz
slx-admin-385146bd844683d0c12b358fee954d414ed88ba1.zip
[statistics] Add shift + click selection to the checkboxes
-rw-r--r--modules-available/statistics/templates/clientlist.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html
index aeca368d..53db7c84 100644
--- a/modules-available/statistics/templates/clientlist.html
+++ b/modules-available/statistics/templates/clientlist.html
@@ -252,6 +252,22 @@ document.addEventListener("DOMContentLoaded", function () {
};
var $boxes = $('.machine-checkbox');
$boxes.change($fn);
+
+ // Shift click selection for the checkboxes
+ var lastChecked = null;
+ $boxes.click(function(e) {
+ if (!lastChecked) {
+ lastChecked = this;
+ return;
+ }
+ if (e.shiftKey) {
+ const start = $boxes.index(this);
+ const end = $boxes.index(lastChecked);
+ $boxes.slice(Math.min(start, end), Math.max(start, end) + 1).prop('checked', lastChecked.checked);
+ }
+ lastChecked = this;
+ });
+
$("button[type=reset]").click(function() { setTimeout($fn, 1); });
if (window && window.opera && window.opera.version && Number(window.opera.version()) < 13) {
$(document).ready(function () {