diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index aeab80c8ce..710080c86d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -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 += "
" + _("This list is shared. Other users will lose access to it.") + "
"; } 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(); } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index 2e29abfd9f..7c5feb8d84 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -640,7 +640,6 @@ }); } confirmModal( message, title, yes_label, no_label, function( result ){ - $("#bootstrap-confirm-box-modal").remove(); if( result ){ $("#delete_suggestions").submit(); } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt index 309c7ae955..fe7f646f31 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt @@ -254,7 +254,6 @@ }); } confirmModal( message, title, yes_label, no_label, function( result ){ - $("#bootstrap-confirm-box-modal").remove(); if( result ){ $("#deletetags").submit(); } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 2f88250b6f..de64c6f63e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -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(); } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index 19882d6a92..db9e2822fe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -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'; diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js index 9a48e3a8f5..526e33e7f7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js @@ -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(); + } }); }