From 7b6107beaf06d3e3956dc69145d966a35de1a59d 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 --- .../intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt | 2 +- koha-tmpl/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 | 2 +- koha-tmpl/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 | 2 +- .../prog/en/modules/tools/batch_record_modification.tt | 2 +- .../intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt | 2 +- 10 files changed, 10 insertions(+), 10 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 cb9ea5270d..fe26aa8d12 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -562,7 +562,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 5b52663852..5700d68dbe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt @@ -140,7 +140,7 @@ e.preventDefault(); EDIModal.modal("hide"); }); - EDIModal.on("hidden", function(){ + EDIModal.on("hidden.bs.modal", function(){ EDIModalBody.html("
\"\" "+_("Loading")+"
"); }); $(".delete_msg").on("click",function(){ 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 29b62e332f..ae5ba5fa03 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt @@ -130,7 +130,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 8ad123b846..b689192bbb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -546,7 +546,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 050cef43f1..d3f499fc57 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1055,7 +1055,7 @@ $("#marcPreview .modal-body").load(page + " table"); $('#marcPreview').modal({show:true}); }); - $("#marcPreview").on("hidden", function(){ + $("#marcPreview").on("hidden.bs.modal", function(){ $("#marcPreview .modal-body").html("
\"\" "+_("Loading")+"
"); }); [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %] 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 19ef710f4e..eef01b8ed8 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 3d2ade6e59..586a495c5c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt @@ -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("
\"\" "+_("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 ca6c118542..8e18d21ffd 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 @@ -150,7 +150,7 @@ patronExportModal.modal("show"); }); - patronExportModal.on("hidden", function(){ + patronExportModal.on("hidden.bs.modal", function(){ patronExportModalBody.html("
\"\" "+_("Loading")+"
"); }); 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 0b975c2766..efa123ab67 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 @@ -301,7 +301,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 3f6184b015..dd0671f052 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 @@ -496,7 +496,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