WordPress.org

Make WordPress Core

Changeset 29907


Ignore:
Timestamp:
10/15/2014 06:25:43 PM (5 years ago)
Author:
ocean90
Message:

Customizer: Don't trigger a change event if two unchanged object values are equal, second pass.

Make Underscore.js a dependency for customize-base and use _.isEqual() to compare the values.
(Underscore.js was already enqueued via wp-util.js for Widgets.)

props westonruter.
fixes #26061.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/customize-base.js

    r29905 r29907  
    185185
    186186            // Bail if the sanitized value is null or unchanged.
    187             if ( null === to || this._value === to )
     187            if ( null === to || _.isEqual( from, to ) )
    188188                return this;
    189189
  • trunk/src/wp-includes/script-loader.php

    r29847 r29907  
    378378    $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r7', 1 );
    379379
    380     $scripts->add( 'customize-base',     "/wp-includes/js/customize-base$suffix.js",     array( 'jquery', 'json2' ), false, 1 );
     380    $scripts->add( 'customize-base',     "/wp-includes/js/customize-base$suffix.js",     array( 'jquery', 'json2', 'underscore' ), false, 1 );
    381381    $scripts->add( 'customize-loader',   "/wp-includes/js/customize-loader$suffix.js",   array( 'customize-base' ), false, 1 );
    382382    $scripts->add( 'customize-preview',  "/wp-includes/js/customize-preview$suffix.js",  array( 'customize-base' ), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.