Media Grid: make the edit attachment icon clickable.

Props ericlewis.
See #24716.


git-svn-id: https://develop.svn.wordpress.org/trunk@29065 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-07-10 15:55:21 +00:00
parent 126b248fa0
commit 868d88800c
3 changed files with 12 additions and 4 deletions

View File

@@ -2643,6 +2643,9 @@ video#inline-media-node {
font-weight: 300;
}
.media-frame.mode-bulk-edit .attachment:hover .inline-toolbar {
display: none;
}
.edit-attachment-frame .edit-media-header .left:before {
content: '\f340';

View File

@@ -1812,7 +1812,7 @@
this.activeModes.on( 'add remove reset', _.bind( this.triggerModeEvents, this ) );
_.each( this.options.mode, function( mode ) {
this.activeModes.add( new Backbone.Model( { id: mode } ) );
this.activateMode( mode );
}, this );
// Force the uploader off if the upload limit has been exceeded or
@@ -2005,7 +2005,11 @@
this.trigger( eventToTrigger );
},
activateMode: function( mode ) {
if ( this.activeModes.where( { id: mode } ).length ) {
return;
}
this.activeModes.add( [ { id: mode } ] );
this.$el.addClass( 'mode-' + mode );
this.trigger( mode + ':activate' );
},
deactivateMode: function( mode ) {
@@ -2014,6 +2018,7 @@
return;
}
this.activeModes.remove( this.activeModes.where( { id: mode } ) );
this.$el.removeClass( 'mode-' + mode );
this.trigger( mode + ':deactivate' );
}
});
@@ -4590,7 +4595,7 @@
},
events: {
'click .attachment-preview': 'toggleSelectionHandler',
'click .js--select-attachment': 'toggleSelectionHandler',
'change [data-setting]': 'updateSetting',
'change [data-setting] input': 'updateSetting',
'change [data-setting] select': 'updateSetting',

View File

@@ -386,11 +386,11 @@ function wp_print_media_templates() {
<script type="text/html" id="tmpl-attachment">
<# if ( _.contains( data.controller.options.mode, 'grid' ) ) { #>
<div class="inline-toolbar">
<div class="inline-toolbar js--select-attachment">
<div class="dashicons dashicons-edit edit edit-media"></div>
</div>
<# } #>
<div class="attachment-preview type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}">
<div class="attachment-preview js--select-attachment type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}">
<# if ( data.uploading ) { #>
<div class="media-progress-bar"><div></div></div>
<# } else if ( 'image' === data.type ) { #>