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:
parent
70dc1d9256
commit
31ce230c58
|
@ -215,7 +215,7 @@ wp.customHtmlWidgets = ( function( $ ) {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
|
onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
|
||||||
control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length );
|
control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 );
|
||||||
control.updateErrorNotice( errorAnnotations );
|
control.updateErrorNotice( errorAnnotations );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue