Bug 21186: Incorrect Bootstrap modal event name in multiple templates
authorOwen Leonard <oleonard@myacpl.org>
Wed, 8 Aug 2018 19:03:38 +0000 (19:03 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 29 Nov 2018 10:44:41 +0000 (11:44 +0100)
Modals in the staff client which load data via AJAX require an "on
close" action in order to clear the modal of the loaded data. The
problem presents itself the second time the modal is opened: The
"loading" message doesn't appear, and the data from the previous link
is shown until the new data loads.

To test, apply the patch and test the following pages. In each case,
click multiple instances of the modal trigger link/button to confirm
that the "loading" message always appears between re-displays of the
modal.

- Acquisitions -> Vendor -> Add to basket -> From a staged file -> Add orders
  - Test the "MARC" and "Card" links
- Acquisitions -> EDIFACT messages
  - Test the "View message" button
- Acquisitions -> Vendor -> Add to basket -> From an existing record
  - Test "View MARC" link
- Acquisitions -> Vendor -> Invoices -> Invoice -> Receipt page
  - Test the "Order," "MARC," and "Card" links.
- Catalog -> Bibliographic record details
  - Test the MARC Preview link.
- Cataloging -> Cataloging search results
  - Test the Actions -> MARC preview and Actions -> Card preview menu
    items
- Cataloging -> Cataloging search results -> Merge
  - Test the "View MARC" linkscataloguing/merge.tt
- Tools -> Patron lists -> Actions -> Print patron cards
- Tools -> Batch record modification -> Results -> Show MARC
- Tools -> Staged MARC record management -> View batch
  - Test MARC preview shown when you click a staged title

Signed-off-by: Cori Lynn Arnold <carnold@dgiinc.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 7b6107beaf06d3e3956dc69145d966a35de1a59d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5d6eb1f67ba10edc83bd4b098ac5238dbfefe139)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt
koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt

index 28a5ded..cd2a053 100644 (file)
             $("#dataPreview .modal-body").load(page + " div");
             $('#dataPreview').modal({show:true});
         });
-        $("#dataPreview").on("hidden", function(){
+        $("#dataPreview").on("hidden.bs.modal", function(){
             $("#dataPreviewLabel").html("");
             $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
         });
index 80affbe..f5019e1 100644 (file)
@@ -28,7 +28,7 @@ $(document).ready(function() {
         e.preventDefault();
         EDIModal.modal("hide");
     });
-    EDIModal.on("hidden", function(){
+    EDIModal.on("hidden.bs.modal", function(){
         EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
     });
     $(".delete_msg").on("click",function(){
index b391b41..e3b48c5 100644 (file)
@@ -21,7 +21,7 @@
         $("#marcPreview .modal-body").load(page + " table");
         $('#marcPreview').modal({show:true});
     });
-    $("#marcPreview").on("hidden", function(){
+    $("#marcPreview").on("hidden.bs.modal", function(){
         $("#marcPreviewLabel").html("");
         $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
     });
index abf255f..02e1d4c 100644 (file)
             $("#dataPreview .modal-body").load(page + " div");
             $('#dataPreview').modal({show:true});
         });
-        $("#dataPreview").on("hidden", function(){
+        $("#dataPreview").on("hidden.bs.modal", function(){
             $("#dataPreviewLabel").html("");
             $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
         });
index ce41465..aea427e 100644 (file)
                 $("#marcPreview .modal-body").load(page + " table");
                 $('#marcPreview').modal({show:true});
             });
-            $("#marcPreview").on("hidden", function(){
+            $("#marcPreview").on("hidden.bs.modal", function(){
                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && ( normalized_isbn || normalized_upc ) ) %]
index c126978..0f7c63c 100644 (file)
@@ -36,7 +36,7 @@
             $("#dataPreview .modal-body").load(page + " div");
             $('#dataPreview').modal({show:true});
         });
-        $("#dataPreview").on("hidden", function(){
+        $("#dataPreview").on("hidden.bs.modal", function(){
             $("#dataPreviewLabel").html("");
             $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
         });
index 464d763..6c64d51 100644 (file)
@@ -27,7 +27,7 @@ div#result { margin-top: 1em; }
             $("#dataPreview .modal-body").load(page + " div");
             $('#dataPreview').modal({show:true});
         });
-        $("#dataPreview").on("hidden", function(){
+        $("#dataPreview").on("hidden.bs.modal", function(){
             $("#dataPreviewLabel").html("");
             $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
         });
index 9bdf4ab..cee81f3 100644 (file)
@@ -31,7 +31,7 @@
             patronExportModal.modal("show");
         });
 
-        patronExportModal.on("hidden", function(){
+        patronExportModal.on("hidden.bs.modal", function(){
             patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
         });
 
index f459133..8395496 100644 (file)
@@ -67,7 +67,7 @@ $(document).ready(function() {
         $("#marcPreview .modal-body").load(page + " div");
         $('#marcPreview').modal({show:true});
     });
-    $("#marcPreview").on("hidden", function(){
+    $("#marcPreview").on("hidden.bs.modal", function(){
         $("#marcPreviewLabel").html("");
         $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
     });
index 78d6864..32cfe5a 100644 (file)
@@ -118,7 +118,7 @@ $(document).ready(function(){
         $("#marcPreview .modal-body").load(page + " table");
         $('#marcPreview').modal({show:true});
     });
-    $("#marcPreview").on("hidden", function(){
+    $("#marcPreview").on("hidden.bs.modal", function(){
         $("#marcPreviewLabel").html("");
         $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
     });