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.
Fixes #42867.

git-svn-id: https://develop.svn.wordpress.org/trunk@42457 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2018-01-15 23:46:02 +00:00
parent 70dc1d9256
commit 31ce230c58

View File

@ -215,7 +215,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 );
}
});