WordPress.org

Make WordPress Core

Changeset 39510


Ignore:
Timestamp:
12/06/2016 02:50:13 AM (3 years ago)
Author:
westonruter
Message:

Customize: Prevent infinite full refresh from occurring when selective refresh falls back for a nav menu that has items excluded from rendering via filtering.

See #37032.
Fixes #38612.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/customize-preview-nav-menus.js

    r39333 r39510  
    1616     */
    1717    self.init = function() {
    18         var self = this;
     18        var self = this, synced = false;
     19
     20        /*
     21         * Keep track of whether we synced to determine whether or not bindSettingListener
     22         * should also initially fire the listener. This initial firing needs to wait until
     23         * after all of the settings have been synced from the pane in order to prevent
     24         * an infinite selective fallback-refresh. Note that this sync handler will be
     25         * added after the sync handler in customize-preview.js, so it will be triggered
     26         * after all of the settings are added.
     27         */
     28        api.preview.bind( 'sync', function() {
     29            synced = true;
     30        } );
    1931
    2032        if ( api.selectiveRefresh ) {
     
    3345                 */
    3446                if ( setting.get() && ! setting.get()._invalid ) {
    35                     self.bindSettingListener( setting, { fire: true } );
     47                    self.bindSettingListener( setting, { fire: synced } );
    3648                }
    3749            } );
Note: See TracChangeset for help on using the changeset viewer.