disable basket actions when none selected
authorGalen Charlton <gmc@equinoxintiative.org>
Mon, 13 Aug 2018 20:25:58 +0000 (16:25 -0400)
committerGalen Charlton <gmc@equinoxintiative.org>
Mon, 13 Aug 2018 20:25:58 +0000 (16:25 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxintiative.org>
Open-ILS/web/js/ui/default/opac/record_selectors.js

index 2f57b05..cf7956a 100644 (file)
                     clear_basket_el.classList.add('hidden');
                 }
             }
+            if (select_action_el) {
+                if (mylist.length > 0) {
+                    select_action_el.removeAttribute('disabled');
+                } else {
+                    select_action_el.setAttribute('disabled', 'disabled');
+                }
+            }
+            if (do_basket_action_el) {
+                if (mylist.length > 0) {
+                    do_basket_action_el.removeAttribute('disabled');
+                } else {
+                    do_basket_action_el.setAttribute('disabled', 'disabled');
+                }
+            }
             if (record_basket_count_el) {
                 record_basket_count_el.innerHTML = mylist.length;
             }