From 5d6eb1f67ba10edc83bd4b098ac5238dbfefe139 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 8 Aug 2018 19:03:38 +0000 Subject: [PATCH] Bug 21186: Incorrect Bootstrap modal event name in multiple templates 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 Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit 7b6107beaf06d3e3956dc69145d966a35de1a59d) Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt | 4 ++-- .../prog/en/modules/tools/batch_record_modification.tt | 2 +- .../intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index c00a00fbe0..4f84505013 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -564,7 +564,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("
\"\" "+_("Loading")+"
"); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt index 67e47313f1..3b7670833b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt @@ -137,8 +137,8 @@ e.preventDefault(); EDIModal.modal("hide"); }); - EDIModal.on("hidden", function(){ - EDIModalBody.html("
\"\" "+_("Loading")+"
"); + EDIModal.on("hidden.bs.modal", function(){ + EDIModalBody.html("
\"\" "+_("Loading")+"
"); }); $(".delete_msg").on("click",function(){ return confirm(_("Are you sure you want to delete this message?")); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt index 8a9de01ba4..e603ee4c95 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt @@ -127,7 +127,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("
\"\" "+_("Loading")+"
"); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index fd5276f526..8a86849dbd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -527,7 +527,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("
\"\" "+_("Loading")+"
"); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index cdf66194a1..5a72fe46b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1026,8 +1026,8 @@ $("#marcPreview .modal-body").load(page + " table"); $('#marcPreview').modal({show:true}); }); - $("#marcPreview").on("hidden", function(){ - $("#marcPreview .modal-body").html("
\"\" "+_("Loading")+"
"); + $("#marcPreview").on("hidden.bs.modal", function(){ + $("#marcPreview .modal-body").html("
\"\" "+_("Loading")+"
"); }); [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %] novSelect.loadContentForQuery({ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt index 7305bd54b6..8bace55edb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -248,7 +248,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("
\"\" "+_("Loading")+"
"); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt index c94d88de30..1bad44d2b9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt @@ -204,7 +204,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("
\"\" "+_("Loading")+"
"); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt index f2cd32df5c..ed5662deed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt @@ -133,8 +133,8 @@ patronExportModal.modal("show"); }); - patronExportModal.on("hidden", function(){ - patronExportModalBody.html("
\"\" "+_("Loading")+"
"); + patronExportModal.on("hidden.bs.modal", function(){ + patronExportModalBody.html("
\"\" "+_("Loading")+"
"); }); patronExportModal.on("submit", "#exportingf", function(e){ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt index bb0962d517..c900ef5999 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -300,7 +300,7 @@ $("#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("
\"\" "+_("Loading")+"
"); }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt index cff595afcf..c109b0137b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt @@ -493,7 +493,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("
\"\" "+_("Loading")+"
"); }); -- 2.39.5