Skip to content

Commit

Permalink
In media.view.BulkSelectionActionButton.click(), do not assume that…
Browse files Browse the repository at this point in the history
… `delete` is the only possible bulk action.

Fixes #29101.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
staylor committed Aug 6, 2014
1 parent 6b8ee09 commit 27b0d4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions wp-includes/js/media-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,12 @@
var selection = this.controller.controller.state().get('selection');
media.view.Button.prototype.click.apply( this, arguments );

// Currently assumes delete is the only action
if ( confirm( l10n.warnBulkDelete ) ) {
while ( selection.length > 0) {
selection.at(0).destroy();
if ( 'delete' === this.controller.model.get( 'currentAction' ) ) {
// Currently assumes delete is the only action
if ( confirm( l10n.warnBulkDelete ) ) {
while ( selection.length > 0 ) {
selection.at(0).destroy();
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/media-grid.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 27b0d4c

Please sign in to comment.