From e5f0b0881cdec9f446b64211972174c8288c52d7 Mon Sep 17 00:00:00 2001 From: minhaz Date: Fri, 18 Apr 2014 17:39:04 +0530 Subject: [PATCH] patch for feature request #1518 Signed-off-by: A V Minhaz --- js/ajax.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/js/ajax.js b/js/ajax.js index 41043f559e..b8cb7a7f54 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -160,6 +160,20 @@ var AJAX = { event.preventDefault(); event.stopImmediatePropagation(); } + + //sometime we accidently click on a url,refresh button or back button + //operation to confirm if user want to leave page in such cases + var flag = false; + $("input[type='text']").each(function(index){ + if($(this).val().length > 0) { + flag = true; + } + }); + //trigger confirm dialog + if (event.type === 'click' && flag && confirm(PMA_messages['strConfirmNavigation']) === false) { + return false; + } + if (AJAX.active === true) { // Cancel the old request if abortable, when the user requests // something else. Otherwise silently bail out, as there is already