Commit 721a1732 authored by Nigel McNie's avatar Nigel McNie
Browse files

When javascript is available, show some links to assist managing the...

When javascript is available, show some links to assist managing the checkboxes for views (select all, reverse selection).
parent c81974c2
......@@ -49,4 +49,28 @@ addLoadEvent(function() {
});
});
// Checkbox helpers
var checkboxes = getElementsByTagAndClassName('input', 'checkbox', 'whatviews');
var checkboxHelperDiv = DIV();
var checkboxSelectAll = A({'href': ''}, 'Select all');
connect(checkboxSelectAll, 'onclick', function(e) {
e.stop();
forEach(checkboxes, function(i) {
i.checked = true;
});
});
var checkboxReverseSelection = A({'href': ''}, 'Reverse selection');
connect(checkboxReverseSelection, 'onclick', function(e) {
e.stop();
forEach(checkboxes, function(i) {
i.checked = !i.checked;
});
});
appendChildNodes(checkboxHelperDiv, checkboxSelectAll, ' | ', checkboxReverseSelection);
insertSiblingNodesBefore(getFirstElementByTagAndClassName('table', null, container), checkboxHelperDiv);
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment