From 04f14a43f513e6df687c9650ba8afc87b45376df Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sun, 18 Mar 2012 23:36:04 +0000 Subject: [PATCH 1/2] PMA_confirm() code clean-up --- js/functions.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/js/functions.js b/js/functions.js index b33507819e..9a63b88606 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1903,17 +1903,24 @@ jQuery.fn.PMA_confirm = function(question, url, callbackFn) { */ var button_options = {}; button_options[PMA_messages['strOK']] = function(){ - $(this).dialog("close").remove(); + $(this).dialog("close"); - if($.isFunction(callbackFn)) { - callbackFn.call(this, url); - } - }; - button_options[PMA_messages['strCancel']] = function() {$(this).dialog("close").remove();} + if($.isFunction(callbackFn)) { + callbackFn.call(this, url); + } + }; + button_options[PMA_messages['strCancel']] = function() { + $(this).dialog("close"); + } - $('
') + $('
', {'id':'confirm_dialog'}) .prepend(question) - .dialog({buttons: button_options}); + .dialog({ + buttons: button_options, + close: function () { + $(this).remove(); + } + }); }; /** From eabe39881178a827786dfbff4a95c817c60f6288 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sun, 18 Mar 2012 23:36:35 +0000 Subject: [PATCH 2/2] Dialogs generated by PMA_confirm() should be modal --- js/functions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/functions.js b/js/functions.js index 9a63b88606..0f2e7da1df 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1919,7 +1919,8 @@ jQuery.fn.PMA_confirm = function(question, url, callbackFn) { buttons: button_options, close: function () { $(this).remove(); - } + }, + modal: true }); };