From 04f14a43f513e6df687c9650ba8afc87b45376df Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sun, 18 Mar 2012 23:36:04 +0000 Subject: [PATCH] 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(); + } + }); }; /**