Changeset 42145 for branches/4.9
- Timestamp:
- 11/10/2017 09:44:44 PM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-admin/js/customize-controls.js
r42137 r42145 8249 8249 // Set up initial notifications. 8250 8250 (function() { 8251 var removedQueryParams = [] ;8251 var removedQueryParams = [], autosaveDismissed = false; 8252 8252 8253 8253 /** … … 8296 8296 8297 8297 /** 8298 * Dismiss autosave. 8299 * 8300 * @returns {void} 8301 */ 8302 function dismissAutosave() { 8303 if ( autosaveDismissed ) { 8304 return; 8305 } 8306 wp.ajax.post( 'customize_dismiss_autosave_or_lock', { 8307 wp_customize: 'on', 8308 customize_theme: api.settings.theme.stylesheet, 8309 customize_changeset_uuid: api.settings.changeset.uuid, 8310 nonce: api.settings.nonce.dismiss_autosave_or_lock, 8311 dismiss_autosave: true 8312 } ); 8313 autosaveDismissed = true; 8314 } 8315 8316 /** 8298 8317 * Add notification regarding the availability of an autosave to restore. 8299 8318 * … … 8320 8339 8321 8340 // Handle dismissal of notice. 8322 li.find( '.notice-dismiss' ).on( 'click', function() { 8323 wp.ajax.post( 'customize_dismiss_autosave_or_lock', { 8324 wp_customize: 'on', 8325 customize_theme: api.settings.theme.stylesheet, 8326 customize_changeset_uuid: api.settings.changeset.uuid, 8327 nonce: api.settings.nonce.dismiss_autosave_or_lock, 8328 dismiss_autosave: true 8329 } ); 8330 } ); 8341 li.find( '.notice-dismiss' ).on( 'click', dismissAutosave ); 8331 8342 8332 8343 return li; … … 8336 8347 // Remove the notification once the user starts making changes. 8337 8348 onStateChange = function() { 8349 dismissAutosave(); 8338 8350 api.notifications.remove( code ); 8339 8351 api.unbind( 'change', onStateChange );
Note: See TracChangeset
for help on using the changeset viewer.