Media: Reset modal after gallery insertion.

Removes hardcoded (and vestigial) 'upload' states in favor of using the default modal state.
When a media toolbar action is triggered, reset the modal after switching to the new state (as opposed to beforehand).

fixes #23675.


git-svn-id: http://core.svn.wordpress.org/trunk@23590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2013-03-03 07:36:21 +00:00
parent 00d88af87a
commit 2798e396e3
1 changed files with 6 additions and 6 deletions

View File

@ -1829,7 +1829,7 @@
featuredImageToolbar: function( toolbar ) {
this.createSelectToolbar( toolbar, {
text: l10n.setFeaturedImage,
state: this.options.state || 'upload'
state: this.options.state
});
},
@ -1857,9 +1857,9 @@
controller.close();
state.trigger( 'update', state.get('library') );
// Restore and reset the default state.
controller.setState( controller.options.state );
controller.reset();
// @todo: Make the state activated dynamic (instead of hardcoded).
controller.setState('upload');
}
}
}
@ -2484,11 +2484,11 @@
if ( options.event )
controller.state().trigger( options.event );
if ( options.reset )
controller.reset();
if ( options.state )
controller.setState( options.state );
if ( options.reset )
controller.reset();
}
});