mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-21 22:15:28 +00:00
Media: Hide "Edit" link in the selection view when it doesn't make sense
Props koopersmith, ocean90, nacin fixes #22713 git-svn-id: http://core.svn.wordpress.org/trunk@23031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dad33047b5
commit
8603ed6082
@ -232,6 +232,8 @@
|
||||
.media-selection .selection-info a:last-child {
|
||||
border-right: 1px;
|
||||
border-left: 0;
|
||||
margin-left: 0;
|
||||
margin-right: -8px;
|
||||
}
|
||||
|
||||
.media-selection:after {
|
||||
|
@ -1116,7 +1116,12 @@
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.media-selection.empty {
|
||||
.media-selection.empty,
|
||||
.media-selection.editing {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-selection.one .edit-selection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -1147,6 +1152,7 @@
|
||||
|
||||
.media-selection .selection-info a:last-child {
|
||||
border-right: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.media-selection .selection-info .clear-selection {
|
||||
|
@ -1567,7 +1567,7 @@
|
||||
toolbar: 'main-gallery',
|
||||
filterable: 'uploaded',
|
||||
multiple: 'add',
|
||||
editable: true,
|
||||
editable: false,
|
||||
|
||||
library: media.query( _.defaults({
|
||||
type: 'image'
|
||||
@ -3638,6 +3638,7 @@
|
||||
|
||||
this.views.set( '.selection-view', this.attachments );
|
||||
this.collection.on( 'add remove reset', this.refresh, this );
|
||||
this.controller.on( 'content:activate', this.refresh, this );
|
||||
},
|
||||
|
||||
ready: function() {
|
||||
@ -3649,9 +3650,15 @@
|
||||
if ( ! this.$el.children().length )
|
||||
return;
|
||||
|
||||
var collection = this.collection,
|
||||
editing = 'edit-selection' === this.controller.content.mode();
|
||||
|
||||
// If nothing is selected, display nothing.
|
||||
this.$el.toggleClass( 'empty', ! this.collection.length );
|
||||
this.$('.count').text( this.collection.length + ' ' + l10n.selected );
|
||||
this.$el.toggleClass( 'empty', ! collection.length );
|
||||
this.$el.toggleClass( 'one', 1 === collection.length );
|
||||
this.$el.toggleClass( 'editing', editing );
|
||||
|
||||
this.$('.count').text( collection.length + ' ' + l10n.selected );
|
||||
},
|
||||
|
||||
edit: function( event ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user