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:
parent
ca180e2544
commit
7029af94e7
|
@ -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
|
@ -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
Loading…
Reference in New Issue