aboutsummaryrefslogtreecommitdiff
path: root/themes/alps/assets/helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/alps/assets/helpers.js')
-rw-r--r--themes/alps/assets/helpers.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/themes/alps/assets/helpers.js b/themes/alps/assets/helpers.js
new file mode 100644
index 0000000..344dd17
--- /dev/null
+++ b/themes/alps/assets/helpers.js
@@ -0,0 +1,24 @@
+(function() {
+ var sheet = document.styleSheets[0];
+ var addCSSRule = function(selector, rules, index) {
+ if ("insertRule" in sheet) {
+ sheet.insertRule(selector + "{" + rules + "}", index);
+ return;
+ }
+ if ("addRule" in sheet) {
+ sheet.addRule(selector, rules, index);
+ }
+ };
+
+ var checkboxAll = document.getElementById("action-checkbox-all");
+ if (checkboxAll) {
+ addCSSRule(".message-list-checkbox", "display: table-cell !important;");
+ checkboxAll.addEventListener("click", function(ev) {
+ var allChecked = this.checked;
+ var inputs = document.querySelectorAll("tr .message-list-checkbox input");
+ Array.prototype.slice.apply().forEach(function(cb) {
+ cb.checked = allChecked;
+ });
+ });
+ }
+})();