Merge pull request #26880 from wpdesk/bugfix/settings-changes-warning
Changed settings warning when leaving page
This commit is contained in:
commit
e340a20312
|
@ -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 = '';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue