Media Grid: Add a View button to Attachment Details modal.

props adamsilverstein.
fixes #28977.

git-svn-id: https://develop.svn.wordpress.org/trunk@29262 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-07-22 01:29:17 +00:00
parent 9106987a3f
commit f171b362a9
2 changed files with 11 additions and 1 deletions

View File

@ -285,7 +285,8 @@
'click .trash-attachment': 'trashAttachment',
'click .edit-attachment': 'editAttachment',
'click .refresh-attachment': 'refreshAttachment',
'click .edit-image': 'handleEditImageClick'
'click .edit-image': 'handleEditImageClick',
'click .view-attachment': 'handleViewAttachmentClick'
},
initialize: function() {
@ -328,6 +329,13 @@
this.controller.setState( 'edit-image' );
},
/**
* When View is clicked, navigate to the attachment page
*/
handleViewAttachmentClick: function() {
window.location = this.model.get( 'link' );
},
afterDelete: function( model ) {
if ( ! model.destroyed ) {
return;

View File

@ -297,6 +297,8 @@ function wp_print_media_templates() {
<a class="button edit-image" href="#"><?php _e( 'Edit Image' ); ?></a>
<# } #>
<a class="button view-attachment" href="#"><?php _e( 'View' ); ?></a>
<# if ( ! data.uploading && data.can.remove ) { #>
<?php if ( MEDIA_TRASH ): ?>
<a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>