Make WordPress Core

Changeset 29262


Ignore:
Timestamp:
07/22/2014 01:29:17 AM (11 years ago)
Author:
SergeyBiryukov
Message:

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

props adamsilverstein.
fixes #28977.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-grid.js

    r29213 r29262  
    286286            'click .edit-attachment':         'editAttachment',
    287287            'click .refresh-attachment':      'refreshAttachment',
    288             'click .edit-image':              'handleEditImageClick'
     288            'click .edit-image':              'handleEditImageClick',
     289            'click .view-attachment':         'handleViewAttachmentClick'
    289290        },
    290291
     
    327328        handleEditImageClick: function() {
    328329            this.controller.setState( 'edit-image' );
     330        },
     331
     332        /**
     333         * When View is clicked, navigate to the attachment page
     334         */
     335        handleViewAttachmentClick: function() {
     336            window.location = this.model.get( 'link' );
    329337        },
    330338
  • trunk/src/wp-includes/media-template.php

    r29212 r29262  
    297297                        <a class="button edit-image" href="#"><?php _e( 'Edit Image' ); ?></a>
    298298                    <# } #>
     299
     300                    <a class="button view-attachment" href="#"><?php _e( 'View' ); ?></a>
    299301
    300302                    <# if ( ! data.uploading && data.can.remove ) { #>
Note: See TracChangeset for help on using the changeset viewer.