diff --git a/assets/js/admin/settings.js b/assets/js/admin/settings.js index ad008ff08fc..5ad5e4e02c9 100644 --- a/assets/js/admin/settings.js +++ b/assets/js/admin/settings.js @@ -72,16 +72,11 @@ var changed = false; $( 'input, textarea, select, checkbox' ).change( function() { - changed = true; - }); - - $( '.woo-nav-tab-wrapper a' ).click( function() { - if ( changed ) { + if ( ! changed ) { window.onbeforeunload = function() { return params.i18n_nav_warning; }; - } else { - window.onbeforeunload = ''; + changed = true; } });