Bug 17602: (follow-up) Adjust js paths to use version add spinner
authorNick Clemens <nick@bywatersolutions.com>
Thu, 5 Apr 2018 16:49:58 +0000 (16:49 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 1 Oct 2018 13:56:58 +0000 (13:56 +0000)
Also included recompiled version of opac.css that we forgot.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recordedbooks-search.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/bootstrap/js/recordedbooks.js

index 07c9f05..aa604ab 100644 (file)
@@ -59,8 +59,8 @@
 
 [% INCLUDE 'opac-bottom.inc' %]
 [% BLOCK jsinclude %]
-<script type="text/javascript" src="[% interface %]/[% theme %]/js/recordedbooks.js"></script>
-<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.rating.js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/recordedbooks_[% KOHA_VERSION %].js"></script>
+<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.rating_[% KOHA_VERSION %].js"></script>
 <script type="text/javascript">
 var querystring = "[% q |replace( "'", "\'" ) |replace( '\n', '\\n' ) |replace( '\r', '\\r' ) |html %]";
 var results_per_page = [% OPACnumSearchResults || 20 %];
index b69fb75..b81eff0 100644 (file)
     </script>
     [% END %]
     [% IF RecordedBooksCirculation %]
-    <script type="text/javascript" src="[% interface %]//[% theme %]/js/recordedbooks.js"></script>
+    <script type="text/javascript" src="[% interface %]//[% theme %]/js/recordedbooks_[% KOHA_VERSION %].js"></script>
     <script type="text/JavaScript">
     $(document).ready(function() {
     [% IF ( recordedbooks_error ) %]
index b0aeccb..24b7082 100644 (file)
@@ -89,7 +89,7 @@ KOHA.RecordedBooks = new function() {
         $('<div id="action_'+item.isbn+'" class="actions-menu">')
             .append(actions)
             .appendTo(line);
-
+        $('<span id="waiting_'+item.isbn+'" style="display:none;"><img class="throbber" src="/opac-tmpl/lib/jquery/plugins/themes/classic/throbber.gif" /></span>').appendTo(line);
         $(ul_el).append(line);
     }
 
@@ -156,6 +156,8 @@ KOHA.RecordedBooks = new function() {
 
     function item_action (params, el) {
         var isbn = params.isbn;
+        $("#action_"+isbn).hide();
+        $("#waiting_"+isbn).show();
         svc_ajax('post', params, function(data) {
             if (data.checkouts) {
                 details.checkouts = data.checkouts;
@@ -164,6 +166,8 @@ KOHA.RecordedBooks = new function() {
                 details.holds = data.holds;
             }
             display_actions(el, isbn);
+              $("#action_"+isbn).show();
+              $("#waiting_"+isbn).hide();
         });
     }
 
@@ -233,6 +237,8 @@ KOHA.RecordedBooks = new function() {
             if(checkout_popup) {
                 $(el).append( ajax_button(MSG_CHECK_OUT, function() {
                     if( confirm(MSG_CHECK_OUT_CONFIRM) ) {
+                       $("#action_"+isbn).hide();
+                       $("#waiting_"+isbn).show();
                         svc_ajax('post', {action: "checkout", isbn: isbn}, function(data) {
                             if (data.checkouts) {
                                 details.checkouts = data.checkouts;
@@ -241,6 +247,8 @@ KOHA.RecordedBooks = new function() {
                                 details.holds = data.holds;
                             }
                             item = display_actions(el, isbn);
+                            $("#action_"+isbn).show();
+                            $("#waiting_"+isbn).hide();
                         });
                     }
                 }) );
@@ -304,6 +312,7 @@ KOHA.RecordedBooks = new function() {
         $('<div id="action_'+isbn+'" class="actions-menu">')
             .append(actions)
             .appendTo(el);
+        $("#action_"+isbn).before('<span id="waiting_'+isbn+'" style="display:none;"><img class="throbber" src="/opac-tmpl/lib/jquery/plugins/themes/classic/throbber.gif" /></span>');
     };
 
     this.search = function( q, page_size, page, callback ) {