Media: Reduces the bulk media options to have one primary button

This fixes where 2 primary buttons were showing for bulk actions within media trash.

Props garrett-eclipse, afercia, ianbelanger, SergeyBiryukov
Fixes #46757, #46758


git-svn-id: https://develop.svn.wordpress.org/trunk@45701 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tammie Lister
2019-07-30 23:19:18 +00:00
parent 2f52d5a897
commit c83f0b0d22
3 changed files with 9 additions and 2 deletions

View File

@@ -190,7 +190,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
disabled: true,
text: mediaTrash ? l10n.trashSelected : l10n.deletePermanently,
controller: this.controller,
priority: -60,
priority: -80,
click: function() {
var changed = [], removed = [],
selection = this.controller.state().get( 'selection' ),
@@ -246,7 +246,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro
if ( mediaTrash ) {
this.toolbar.set( 'deleteSelectedPermanentlyButton', new wp.media.view.DeleteSelectedPermanentlyButton({
filters: Filters,
style: 'primary',
style: 'link button-link-delete',
disabled: true,
text: l10n.deletePermanently,
controller: this.controller,

View File

@@ -22,6 +22,7 @@ DeleteSelected = Button.extend(/** @lends wp.media.view.DeleteSelectedButton.pro
this.options.filters.model.on( 'change', this.filterChange, this );
}
this.controller.on( 'selection:toggle', this.toggleDisabled, this );
this.controller.on( 'select:activate', this.toggleDisabled, this );
},
filterChange: function( model ) {

View File

@@ -224,6 +224,12 @@ TABLE OF CONTENTS:
.wp-core-ui .button-link-delete:hover,
.wp-core-ui .button-link-delete:focus {
color: #dc3232;
background: transparent;
}
.wp-core-ui .button-link-delete:disabled {
/* overrides the default buttons disabled background */
background: transparent !important;
}
.ie8 .wp-core-ui .button-link:focus {