Refine media state machine methods.

* state( id ) becomes setState( id )
* get( id ) becomes state( id )
* state() stays the same
* previous() becomes lastState()

Props koopersmith
fixes #22652


git-svn-id: https://develop.svn.wordpress.org/trunk@22952 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-11-30 15:19:11 +00:00
parent d7ec10376b
commit 06b9663f58
7 changed files with 46 additions and 43 deletions
+2 -2
View File
@@ -1020,7 +1020,7 @@ function post_thumbnail_meta_box( $post ) {
$thumbnailId.val( thumbnailId );
if ( frame ) {
selection = frame.get('library').get('selection');
selection = frame.state('library').get('selection');
if ( -1 === thumbnailId )
selection.clear();
@@ -1055,7 +1055,7 @@ function post_thumbnail_meta_box( $post ) {
frame = wp.media( options );
frame.get('library').set( 'filterable', 'uploaded' );
frame.state('library').set( 'filterable', 'uploaded' );
frame.toolbar.on( 'activate:select', function() {
frame.toolbar.view().set({