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

props adamsilverstein.
fixes #28977.
Built from https://develop.svn.wordpress.org/trunk@29262


git-svn-id: http://core.svn.wordpress.org/trunk@29045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-07-22 01:30:16 +00:00
parent b9222c9e1e
commit 8923bb0c0e
4 changed files with 13 additions and 3 deletions

View File

@ -285,7 +285,8 @@
'click .trash-attachment': 'trashAttachment', 'click .trash-attachment': 'trashAttachment',
'click .edit-attachment': 'editAttachment', 'click .edit-attachment': 'editAttachment',
'click .refresh-attachment': 'refreshAttachment', 'click .refresh-attachment': 'refreshAttachment',
'click .edit-image': 'handleEditImageClick' 'click .edit-image': 'handleEditImageClick',
'click .view-attachment': 'handleViewAttachmentClick'
}, },
initialize: function() { initialize: function() {
@ -328,6 +329,13 @@
this.controller.setState( 'edit-image' ); 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 ) { afterDelete: function( model ) {
if ( ! model.destroyed ) { if ( ! model.destroyed ) {
return; return;

File diff suppressed because one or more lines are too long

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 edit-image" href="#"><?php _e( 'Edit Image' ); ?></a>
<# } #> <# } #>
<a class="button view-attachment" href="#"><?php _e( 'View' ); ?></a>
<# if ( ! data.uploading && data.can.remove ) { #> <# if ( ! data.uploading && data.can.remove ) { #>
<?php if ( MEDIA_TRASH ): ?> <?php if ( MEDIA_TRASH ): ?>
<a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a> <a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.0-beta2-20140721'; $wp_version = '4.0-beta2-20140722';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.