more fixed to select-all checkbox management
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 15 Jun 2018 17:11:19 +0000 (13:11 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 15 Jun 2018 17:11:19 +0000 (13:11 -0400)
Open-ILS/web/js/ui/default/opac/record_selectors.js

index 0faa7fc..89de973 100644 (file)
     initialize();
 
     function syncPageState() {
+        var all_checked = true;
         [].forEach.call(rec_selectors, function(el) {
             el.checked = mylist.includes(parseInt(el.value));
             if (el.checked) {
                 adjustLegacyControlsVis('checked', el.value);
             } else {
+                all_checked = false;
                 adjustLegacyControlsVis('unchecked', el.value);
             }
             toggleRowHighlighting(el);
         });
+        if (select_all_records_el && rec_selectors.length) {
+            select_all_records_el.checked = all_checked;
+        }
         checkMaxCartSize();
     }