From e6c6dff9f93ae445a988f9b0899076372bcb3ed4 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 (cherry picked from commit 5d6eb1f67ba10edc83bd4b098ac5238dbfefe139) Signed-off-by: Fridolin Somers --- .../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 28a5ded460..cd2a053019 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -149,7 +149,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 80affbee80..f5019e12fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt @@ -28,7 +28,7 @@ $(document).ready(function() { 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 b391b41f96..e3b48c5858 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt @@ -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("
\"\" "+_("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 abf255f270..02e1d4cbce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -112,7 +112,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 ce41465e13..aea427e902 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1035,7 +1035,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('NovelistSelectProfile') && ( 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 c126978852..0f7c63c6d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -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("
\"\" "+_("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 464d763e34..6c64d51c66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt @@ -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("
\"\" "+_("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 9bdf4ab071..cee81f36e4 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 @@ -31,7 +31,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 f45913316f..8395496b4f 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 @@ -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("
\"\" "+_("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 78d68646eb..32cfe5a861 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 @@ -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("
\"\" "+_("Loading")+"
"); }); -- 2.39.5