Make WordPress Core

Changeset 29443


Ignore:
Timestamp:
08/07/2014 10:32:58 PM (11 years ago)
Author:
wonderboymusic
Message:

Media Grid: remove Router code that doesn't actually ever run.

See #29121.

File:
1 edited

Legend:

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

    r29434 r29443  
    267267        routes: {
    268268            'upload.php?item=:slug':    'showItem',
    269             'upload.php?search=:query': 'search',
    270             ':default':                 'defaultRoute'
     269            'upload.php?search=:query': 'search'
    271270        },
    272271
     
    278277        // Respond to the search route by filling the search field and trigggering the input event
    279278        search: function( query ) {
    280             // Ensure modal closed, see back button
    281             this.closeModal();
    282279            $( '#media-search-input' ).val( query ).trigger( 'input' );
    283280        },
     
    287284            var library = media.frame.state().get('library');
    288285
    289             // Remove existing modal if present
    290             this.closeModal();
    291286            // Trigger the media frame to open the correct item
    292287            media.frame.trigger( 'edit:attachment', library.findWhere( { id: parseInt( query, 10 ) } ) );
    293         },
    294 
    295         // Close the modal if set up
    296         closeModal: function() {
    297             if ( media.frame.modal ) {
    298                 media.frame.modal.close();
    299             }
    300         },
    301 
    302         // Default route: make sure the modal and search are reset
    303         defaultRoute: function() {
    304             this.closeModal();
    305             $( '#media-search-input' ).val( '' ).trigger( 'input' );
    306288        }
    307289    });
     
    345327
    346328            this.gridRouter = this.options.gridRouter;
     329
    347330            this.library = this.options.library;
    348331
Note: See TracChangeset for help on using the changeset viewer.