Make WordPress Core

Changeset 23031


Ignore:
Timestamp:
12/04/2012 06:23:47 PM (12 years ago)
Author:
ryan
Message:

Media: Hide "Edit" link in the selection view when it doesn't make sense

Props koopersmith, ocean90, nacin
fixes #22713

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/css/media-views-rtl.css

    r23006 r23031  
    233233    border-right: 1px;
    234234    border-left: 0;
     235    margin-left: 0;
     236    margin-right: -8px;
    235237}
    236238
  • trunk/wp-includes/css/media-views.css

    r23026 r23031  
    11171117}
    11181118
    1119 .media-selection.empty {
     1119.media-selection.empty,
     1120.media-selection.editing {
     1121    display: none;
     1122}
     1123
     1124.media-selection.one .edit-selection {
    11201125    display: none;
    11211126}
     
    11481153.media-selection .selection-info a:last-child {
    11491154    border-right: 0;
     1155    margin-right: 0;
    11501156}
    11511157
  • trunk/wp-includes/js/media-views.js

    r23029 r23031  
    15681568                    filterable: 'uploaded',
    15691569                    multiple:   'add',
    1570                     editable:   true,
     1570                    editable:   false,
    15711571
    15721572                    library:  media.query( _.defaults({
     
    36393639            this.views.set( '.selection-view', this.attachments );
    36403640            this.collection.on( 'add remove reset', this.refresh, this );
     3641            this.controller.on( 'content:activate', this.refresh, this );
    36413642        },
    36423643
     
    36503651                return;
    36513652
     3653            var collection = this.collection,
     3654                editing = 'edit-selection' === this.controller.content.mode();
     3655
    36523656            // If nothing is selected, display nothing.
    3653             this.$el.toggleClass( 'empty', ! this.collection.length );
    3654             this.$('.count').text( this.collection.length + ' ' + l10n.selected );
     3657            this.$el.toggleClass( 'empty', ! collection.length );
     3658            this.$el.toggleClass( 'one', 1 === collection.length );
     3659            this.$el.toggleClass( 'editing', editing );
     3660
     3661            this.$('.count').text( collection.length + ' ' + l10n.selected );
    36553662        },
    36563663
Note: See TracChangeset for help on using the changeset viewer.