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 <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 7b6107beaf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5d6eb1f67b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Owen Leonard 2018-08-08 19:03:38 +00:00 committed by Fridolin Somers
parent 5b4e7813cd
commit e6c6dff9f9
10 changed files with 10 additions and 10 deletions

View File

@ -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("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
});

View 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(){

View 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>");
});

View File

@ -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("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
});

View File

@ -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("<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 ) ) %]

View 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>");
});

View 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>");
});

View 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>");
});

View 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>");
});

View 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>");
});