mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-31 21:48:36 +01:00
Widgets: When checking for errors in Custom HTML widget, pass correct value to toggleClass()
for Save button.
`toggleClass()` expects a boolean as a second argument, not an integer. Props iCaleb. Merges 42457 to the 4.9 branch. Fixes #42867. Built from https://develop.svn.wordpress.org/branches/4.9@42458 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d72fbf753f
commit
3bc41df4e4
@ -204,7 +204,7 @@ wp.customHtmlWidgets = ( function( $ ) {
|
||||
* @returns {void}
|
||||
*/
|
||||
onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
|
||||
control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length );
|
||||
control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 );
|
||||
control.updateErrorNotice( errorAnnotations );
|
||||
}
|
||||
});
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user