Media Grid: after completing a Bulk action, switch from select
to edit
mode.
Fixes #28842. git-svn-id: https://develop.svn.wordpress.org/trunk@29566 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4a31c2f74a
commit
87366e71ca
@ -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' );
|
||||
}
|
||||
|
@ -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' );
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user