Skip to content

Commit

Permalink
Improve message
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Delisle <marc@infomarc.info>
  • Loading branch information
lem9 committed Apr 19, 2014
1 parent 8442db4 commit 928dc12
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/ajax.js
Expand Up @@ -163,14 +163,14 @@ var AJAX = {

//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;
var foundFieldNotEmpty = false;
$("input[type='text']").each(function(index){
if($(this).val().length > 0) {
flag = true;
if ($(this).val().length > 0) {
foundFieldNotEmpty = true;
}
});
//trigger confirm dialog
if (event.type === 'click' && flag && confirm(PMA_messages['strConfirmNavigation']) === false) {
if (event.type === 'click' && foundFieldNotEmpty && confirm(PMA_messages['strConfirmNavigation']) === false) {
return false;
}

Expand Down

0 comments on commit 928dc12

Please sign in to comment.