Ticket #32941: 32941.2.patch
File 32941.2.patch, 1.7 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
3338 3338 } ); 3339 3339 request = wp.ajax.post( 'customize_save', query ); 3340 3340 3341 //Disable save button during the save request. 3342 saveBtn.prop( 'disabled', true ); 3343 3344 //Set to false because changes are saving. 3345 api.is_dirty = false; 3346 3341 3347 api.trigger( 'save', request ); 3342 3348 3343 3349 request.always( function () { … … 3362 3368 } ); 3363 3369 } 3364 3370 api.trigger( 'error', response ); 3371 3372 saveBtn.prop( 'disabled', false ); 3365 3373 } ); 3366 3374 3367 3375 request.done( function( response ) { 3368 // Clear setting dirty states 3369 api.each( function ( value ) { 3370 value._dirty = false; 3371 } ); 3376 //If any setting changed during the save request then keep enable save button. 3377 if( api.is_dirty ) { 3378 api.state('saved').set( false ); 3379 saveBtn.prop( 'disabled', false ); 3380 } else { 3381 // Clear setting dirty states 3382 api.each( function ( value ) { 3383 value._dirty = false; 3384 } ); 3372 3385 3373 api.previewer.send( 'saved', response );3386 api.previewer.send( 'saved', response ); 3374 3387 3375 api.trigger( 'saved', response ); 3388 api.trigger( 'saved', response ); 3389 } 3376 3390 } ); 3377 3391 }; 3378 3392 … … 3580 3594 activated( api.settings.theme.active ); 3581 3595 processing( 0 ); 3582 3596 3597 //To check whether any setting changed during the save request. 3598 api.is_dirty = false; 3599 3583 3600 api.bind( 'change', function() { 3584 3601 state('saved').set( false ); 3602 api.is_dirty = true; 3585 3603 }); 3586 3604 3587 3605 api.bind( 'saved', function() {