Bug 38268: (follow-up) Prevent callbacks from being duplicated
This patch moves the logic up one level into the confirmModal function
to prevent future regressions
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1fc336d6bd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
parent
7e5319280a
commit
1667d7db42
|
|
@ -952,7 +952,6 @@ $(function() {
|
|||
});
|
||||
}
|
||||
confirmModal( message, title, yes_label, no_label, function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
if( result ){
|
||||
if( biblionumber ){
|
||||
$("#shelf_delete_biblionumber").val( biblionumber );
|
||||
|
|
@ -1005,7 +1004,6 @@ $(function() {
|
|||
message += "<p>" + _("This list is shared. Other users will lose access to it.") + "</p>";
|
||||
}
|
||||
confirmModal( message, _("Are you sure you want to delete this list?"), _("Yes, delete"), _("No, do not delete"), function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
if( result ){
|
||||
$("#deleteshelf" + shelf_number ).submit();
|
||||
}
|
||||
|
|
@ -1018,7 +1016,6 @@ $(function() {
|
|||
var shelf_name = $(this).data("shelfname");
|
||||
var shelf_number = $(this).data("shelfnumber");
|
||||
confirmModal( shelf_name, _("Are you sure you want to remove sharing? You will no longer have access to the list."), _("Yes, remove sharing"), _("No, do not remove sharing"), function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
if( result ){
|
||||
$("#unshare" + shelf_number ).submit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -640,7 +640,6 @@
|
|||
});
|
||||
}
|
||||
confirmModal( message, title, yes_label, no_label, function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
if( result ){
|
||||
$("#delete_suggestions").submit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,7 +254,6 @@
|
|||
});
|
||||
}
|
||||
confirmModal( message, title, yes_label, no_label, function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
if( result ){
|
||||
$("#deletetags").submit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1116,7 +1116,6 @@
|
|||
var hold_title = $(this).data("title");
|
||||
var reserve_id = $(this).data("reserve_id");
|
||||
confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove()
|
||||
if( result ){
|
||||
$("#delete_hold_" + reserve_id ).submit();
|
||||
}
|
||||
|
|
@ -1129,7 +1128,6 @@
|
|||
var hold_title = $(this).data("title");
|
||||
var reserve_id = $(this).data("reserve_id");
|
||||
confirmModal( hold_title, _("Are you sure you want to request cancelling this hold?"), _("Yes"), _("No"), function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove()
|
||||
if( result ){
|
||||
$("#req_cancel_hold_" + reserve_id ).submit();
|
||||
}
|
||||
|
|
@ -1143,7 +1141,6 @@
|
|||
var article_request_id = $(this).data("article-request_id");
|
||||
(function(row){
|
||||
var doCancel = function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
if( result ){
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
|
|
@ -1194,7 +1191,6 @@
|
|||
var title = _("Are you sure you want to suspend all holds?");
|
||||
var body = _("All holds will be suspended.");
|
||||
confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove()
|
||||
if( result ){
|
||||
$("#suspend_all_holds").submit();
|
||||
}
|
||||
|
|
@ -1207,7 +1203,6 @@
|
|||
var title = _("Are you sure you want to resume all suspended holds?");
|
||||
var body = _("All holds will resume.");
|
||||
confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){
|
||||
$("#bootstrap-confirm-box-modal").remove()
|
||||
if( result ){
|
||||
$("#resume_all_holds").submit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -607,7 +607,6 @@
|
|||
[% IF Koha.Preference('SelfCheckReceiptPrompt') %]
|
||||
var confirmStart = Date.now();
|
||||
confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function(result) {
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
if ( result && (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) {
|
||||
var win = window.open("/cgi-bin/koha/sco/printslip.pl?print=qslip");
|
||||
location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
|
||||
|
|
|
|||
|
|
@ -135,8 +135,10 @@ function confirmModal(message, title, yes_label, no_label, callback) {
|
|||
return false;
|
||||
});
|
||||
$("#bootstrap-confirm-box-modal").on("hide.bs.modal", function () {
|
||||
if (callback)
|
||||
if (callback) {
|
||||
callback($("#bootstrap-confirm-box-modal").data("confirm-yes"));
|
||||
$("#bootstrap-confirm-box-modal").remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue