change style of action menu
authorGalen Charlton <gmc@equinoxintiative.org>
Mon, 13 Aug 2018 20:09:07 +0000 (16:09 -0400)
committerGalen Charlton <gmc@equinoxintiative.org>
Mon, 13 Aug 2018 20:09:07 +0000 (16:09 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxintiative.org>
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/cart.tt2
Open-ILS/web/js/ui/default/opac/record_selectors.js
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 76ea1bd..31bd817 100644 (file)
@@ -1075,17 +1075,9 @@ tr.result_table_row > td.result_table_pic_header {
     [% ELSE; %]
     float: right;
     [% END; %]
-    color: [% css_colors.button_text %];
-    font-weight: bold;
-    text-decoration: none;
-    cursor: pointer !important;
-    border-radius: 5px;
-    border: 1px solid [% css_colors.primary %];
-    background-color:  [% css_colors.primary_fade %];
 }
-#basket_actions a {
-    color: [% css_colors.button_text %];
-    text-decoration: none;
+#basket_actions select {
+    border-color: rgb(169, 169, 169);
 }
 
 .result_number {
index 0daf7fc..bf7a6e5 100644 (file)
@@ -1,21 +1,21 @@
 <div id="record_basket">
-  <ul id="basket_actions" class="popmenu">
-    <li><a href="#" class="no-dec">[% l('Basket Actions') %]</a>
-      <ul>
-        <li><a href="[% mkurl(ctx.opac_root _ '/mylist', {}) %]">[% l('View Basket') %]</a></li>
-        <li><a href="[% mkurl(ctx.opac_root _ '/mylist/move', { action => 'place_hold', entire_list => 1 }) %]">[% l('Place Holds') %]</a></li>
-        <li><a href="[% mkurl(ctx.opac_root _ '/mylist/print', {}) %]">[% l('Print Title Details') %]</a></li>
-        <li><a href="[% mkurl(ctx.opac_root _ '/mylist/email', {}) %]">[% l('Email Title Details') %]</a></li>
-        [% IF !ctx.is_browser_staff %]
-        <li><a href="[% mkurl(ctx.opac_root _ '/myopac/lists', { move_cart_by_default => 1 }) %]">[% l('Add Basket to Saved List') %]</a></li>
-        [% END %]
-        [% IF ctx.is_browser_staff %]
-        <li><a id="add_cart_to_bucket">[% l('Add Basket to Bucket') %]</a></li>
-        [% END %]
-        <li><a href="[% mkurl(ctx.opac_root _ '/mylist/clear', {}) %]">[% l('Clear Basket') %]</a></li>
-      </ul>
-    </li>
-  </ul>
+  <div id="basket_actions">
+    <select id="select_basket_action">
+      <option value="">[% l('-- Basket Actions --') %]</option>
+      <option value="[% mkurl(ctx.opac_root _ '/mylist', {}) %]">[% l('View Basket') %]</a></option>
+      <option value="[% mkurl(ctx.opac_root _ '/mylist/move', { action => 'place_hold', entire_list => 1 }) %]">[% l('Place Holds') %]</a></option>
+      <option value="[% mkurl(ctx.opac_root _ '/mylist/print', {}) %]">[% l('Print Title Details') %]</a></option>
+      <option value="[% mkurl(ctx.opac_root _ '/mylist/email', {}) %]">[% l('Email Title Details') %]</a></option>
+      [% IF !ctx.is_browser_staff %]
+      <option value="[% mkurl(ctx.opac_root _ '/myopac/lists', { move_cart_by_default => 1 }) %]">[% l('Add Basket to Saved List') %]</a></option>
+      [% END %]
+      [% IF ctx.is_browser_staff %]
+      <option value="add_cart_to_bucket">[% l('Add Basket to Bucket') %]</option>
+      [% END %]
+      <option value="[% mkurl(ctx.opac_root _ '/mylist/clear', {}) %]">[% l('Clear Basket') %]</a></option>
+    </select>
+    <input class="opac-button" type="submit" id="do_basket_action" value="[% l('Go') %]" />
+  </div>
   <div id="record_basket_icon">
      <a href="[% mkurl(ctx.opac_root _ '/mylist') %]" class="no-dec" rel="nofollow" vocab="">
        <img src="[% ctx.media_prefix %]/images/cart-sm.png[% ctx.cache_key %]" alt="[% l('View Basket') %]">
index c396abe..2f57b05 100644 (file)
@@ -7,6 +7,8 @@
     var selected_records_count_el = document.getElementById('selected_records_count');
     var select_all_records_el = document.getElementById('select_all_records');
     var clear_basket_el = document.getElementById('clear_basket');
+    var select_action_el = document.getElementById('select_basket_action');
+    var do_basket_action_el = document.getElementById('do_basket_action');
     var mylist = [];
 
     function initialize() {
         });
     });
 
+    if (do_basket_action_el) {
+        do_basket_action_el.addEventListener('click', function(evt) {
+            if (select_action_el.options[select_action_el.selectedIndex].value) { 
+                window.location.href = select_action_el.options[select_action_el.selectedIndex].value;
+            }
+            evt.preventDefault();
+        });
+    }
+
 })();
index 35a72bc..12d397c 100644 (file)
@@ -606,8 +606,10 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
                     $(doc).find('#hold_usr_input').change();
                 });
             });
-            $(doc).find('#add_cart_to_bucket').on('click', function() {
-                $scope.add_cart_to_record_bucket();
+            $(doc).find('#select_basket_action').on('change', function() {
+                if (this.options[this.selectedIndex].value && this.options[this.selectedIndex].value == "add_cart_to_bucket") {
+                    $scope.add_cart_to_record_bucket();
+                }
             });
         }