show clear cart link only when cart has contents
authorGalen Charlton <gmc@equinoxintiative.org>
Sat, 11 Aug 2018 00:28:47 +0000 (20:28 -0400)
committerGalen Charlton <gmc@equinoxintiative.org>
Sat, 11 Aug 2018 00:28:47 +0000 (20:28 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxintiative.org>
Open-ILS/web/js/ui/default/opac/record_selectors.js

index 23e7692..c396abe 100644 (file)
             if (selected_records_count_el) {
                 selected_records_count_el.innerHTML = mylist.length;
             }
+            if (clear_basket_el) {
+                if (mylist.length > 0) {
+                    clear_basket_el.classList.remove('hidden');
+                } else {
+                    clear_basket_el.classList.add('hidden');
+                }
+            }
             if (record_basket_count_el) {
                 record_basket_count_el.innerHTML = mylist.length;
             }