mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
Customize: Allow notifications for linting errors in code editor control (for Additional CSS) to be overridden to allow saving.
Implements the same override that was implemented in [41721] for the theme/plugin editors. See #41897, #41887. Fixes #42528. git-svn-id: https://develop.svn.wordpress.org/trunk@42171 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5280,6 +5280,27 @@
|
||||
codemirror: $.Deferred()
|
||||
} );
|
||||
api.Control.prototype.initialize.call( control, id, options );
|
||||
|
||||
// Note that rendering is debounced so the props will be used when rendering happens after add event.
|
||||
control.notifications.bind( 'add', function( notification ) {
|
||||
|
||||
// Skip if control notification is not from setting csslint_error notification.
|
||||
if ( notification.code !== control.setting.id + ':csslint_error' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Customize the template and behavior of csslint_error notifications.
|
||||
notification.templateId = 'customize-code-editor-lint-error-notification';
|
||||
notification.render = (function( render ) {
|
||||
return function() {
|
||||
var li = render.call( this );
|
||||
li.find( 'input[type=checkbox]' ).on( 'click', function() {
|
||||
control.setting.notifications.remove( 'csslint_error' );
|
||||
} );
|
||||
return li;
|
||||
};
|
||||
})( notification.render );
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user