WordPress.org

Make WordPress Core

Changeset 23268


Ignore:
Timestamp:
01/04/13 20:01:04 (16 months ago)
Author:
nacin
Message:

Media: Check that a router region exists before attempting to access its child views. Add relevant documentation.

Merges [23260] to the 3.5 branch.

props koopersmith.
fixes #22930.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.5/wp-includes/js/media-views.js

    r23164 r23268  
    523523                mode = frame.content.mode(); 
    524524 
    525             if ( this.active && ! selection.length && ! router.get( mode ) ) 
     525            // If the state is active, no items are selected, and the current 
     526            // content mode is not an option in the state's router (provided 
     527            // the state has a router), reset the content mode to the default. 
     528            if ( this.active && ! selection.length && router && ! router.get( mode ) ) 
    526529                this.frame.content.render( this.get('content') ); 
    527530        }, 
Note: See TracChangeset for help on using the changeset viewer.