Merge pull request #26880 from wpdesk/bugfix/settings-changes-warning

Changed settings warning when leaving page
This commit is contained in:
Claudio Sanches 2020-07-14 13:40:05 -03:00 committed by GitHub
commit e340a20312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -72,16 +72,11 @@
var changed = false; var changed = false;
$( 'input, textarea, select, checkbox' ).change( function() { $( 'input, textarea, select, checkbox' ).change( function() {
changed = true; if ( ! changed ) {
});
$( '.woo-nav-tab-wrapper a' ).click( function() {
if ( changed ) {
window.onbeforeunload = function() { window.onbeforeunload = function() {
return params.i18n_nav_warning; return params.i18n_nav_warning;
}; };
} else { changed = true;
window.onbeforeunload = '';
} }
}); });