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:
Sergey Biryukov 2018-01-15 23:51:38 +00:00
parent d72fbf753f
commit 3bc41df4e4
2 changed files with 2 additions and 2 deletions

View File

@ -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