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)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 29 Oct 2018 00:31:50 +0000 (00:31 +0000)
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>
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 cb9ea52..fe26aa8 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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
index 5b52663..5700d68 100644 (file)
                 e.preventDefault();
                 EDIModal.modal("hide");
             });
-            EDIModal.on("hidden", function(){
+            EDIModal.on("hidden.bs.modal", function(){
                 EDIModalBody.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
             $(".delete_msg").on("click",function(){
index 29b62e3..ae5ba5f 100644 (file)
                 $("#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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
index 8ad123b..b689192 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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
index 050cef4..d3f499f 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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
index 19ef710..eef01b8 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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
index 3d2ade6..586a495 100644 (file)
@@ -202,7 +202,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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
                 });
index ca6c118..8e18d21 100644 (file)
                 patronExportModal.modal("show");
             });
 
-            patronExportModal.on("hidden", function(){
+            patronExportModal.on("hidden.bs.modal", function(){
                 patronExportModalBody.html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
 
index 0b975c2..efa123a 100644 (file)
                 $("#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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });
index 3f6184b..dd0671f 100644 (file)
                 $("#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 | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });