WordPress.org

Make WordPress Core

Changeset 42457


Ignore:
Timestamp:
01/15/2018 11:46:02 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/widgets/custom-html-widgets.js

    r42403 r42457  
    216216                 */
    217217                onUpdateErrorNotice: function onUpdateErrorNotice( errorAnnotations ) {
    218                     control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length );
     218                    control.saveButton.toggleClass( 'validation-blocked disabled', errorAnnotations.length > 0 );
    219219                    control.updateErrorNotice( errorAnnotations );
    220220                }
Note: See TracChangeset for help on using the changeset viewer.