Media: Check that a router region exists before attempting to access its child views. Add relevant documentation. see #22930.
git-svn-id: https://develop.svn.wordpress.org/trunk@23260 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
45d01dad51
commit
2b5612e266
|
@ -522,7 +522,10 @@
|
||||||
router = frame.router.get(),
|
router = frame.router.get(),
|
||||||
mode = frame.content.mode();
|
mode = frame.content.mode();
|
||||||
|
|
||||||
if ( this.active && ! selection.length && ! router.get( mode ) )
|
// If the state is active, no items are selected, and the current
|
||||||
|
// content mode is not an option in the state's router (provided
|
||||||
|
// the state has a router), reset the content mode to the default.
|
||||||
|
if ( this.active && ! selection.length && router && ! router.get( mode ) )
|
||||||
this.frame.content.render( this.get('content') );
|
this.frame.content.render( this.get('content') );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue