Media Grid: after completing a Bulk action, switch from `select` to `edit` mode.

Fixes #28842.

Built from https://develop.svn.wordpress.org/trunk@29566


git-svn-id: http://core.svn.wordpress.org/trunk@29340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-21 04:20:16 +00:00
parent ca180e2544
commit 7029af94e7
4 changed files with 11 additions and 5 deletions

View File

@ -136,7 +136,7 @@
toolbar: 'select',
contentUserSetting: false,
filterable: 'all',
autoSelect: false
autoSelect: false
})
]);
},
@ -583,12 +583,17 @@
initialize: function() {
media.view.Button.prototype.initialize.apply( this, arguments );
this.listenTo( this.controller, 'select:activate select:deactivate', this.toggleBulkEditHandler );
this.listenTo( this.controller, 'selection:action:done', this.back );
},
back: function () {
this.controller.deactivateMode( 'select' ).activateMode( 'edit' );
},
click: function() {
media.view.Button.prototype.click.apply( this, arguments );
if ( this.controller.isModeActive( 'select' ) ) {
this.controller.deactivateMode( 'select' ).activateMode( 'edit' );
this.back();
} else {
this.controller.deactivateMode( 'edit' ).activateMode( 'select' );
}

File diff suppressed because one or more lines are too long

View File

@ -5864,7 +5864,7 @@
controller: this.controller,
priority: -60,
click: function() {
var model, changed = [],
var model, changed = [], self = this,
selection = this.controller.state().get( 'selection' ),
library = this.controller.state().get( 'library' );
@ -5901,6 +5901,7 @@
if ( changed.length ) {
$.when.apply( null, changed ).then( function() {
library._requery( true );
self.controller.trigger( 'selection:action:done' );
} );
}
}

File diff suppressed because one or more lines are too long