Make WordPress Core

Changeset 29074


Ignore:
Timestamp:
07/10/2014 06:42:15 PM (10 years ago)
Author:
wonderboymusic
Message:

Media Grid: add disambiguation between generic frames and routers and the router specifically interacting with the grid's frame.
See #24716.

File:
1 edited

Legend:

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

    r29073 r29074  
    154154
    155155        createRouter: function() {
    156             this.gridRouter = new media.view.Frame.Router( this );
     156            this.gridRouter = new media.view.MediaFrame.Manage.Router();
    157157
    158158            // Verify pushState support and activate
     
    336336     * A router for handling the browser history and application state
    337337     */
    338     media.view.Frame.Router = Backbone.Router.extend({
    339 
    340         mediaFrame: '',
    341 
    342         initialize: function( mediaFrame ){
    343             this.mediaFrame = mediaFrame;
    344         },
    345 
     338    media.view.MediaFrame.Manage.Router = Backbone.Router.extend({
    346339        routes: {
    347340            'upload.php?item=:slug':    'showitem',
     
    364357        // Show the modal with a specific item
    365358        showitem: function( query ) {
    366             var library = this.mediaFrame.state().get('library');
     359            var library = media.frame.state().get('library');
    367360
    368361            // Remove existing modal if present
    369362            this.closeModal();
    370363            // Trigger the media frame to open the correct item
    371             this.mediaFrame.trigger( 'edit:attachment', library.findWhere( { id: parseInt( query, 10 ) } ) );
     364            media.frame.trigger( 'edit:attachment', library.findWhere( { id: parseInt( query, 10 ) } ) );
    372365        },
    373366
    374367        // Close the modal if set up
    375368        closeModal: function() {
    376             if ( 'undefined' !== typeof this.mediaFrame.editAttachmentFrame ) {
    377                 this.mediaFrame.editAttachmentFrame.modal.close();
     369            if ( media.frame.modal ) {
     370                media.frame.modal.close();
    378371            }
    379372        },
Note: See TracChangeset for help on using the changeset viewer.