Changeset 29074
- Timestamp:
- 07/10/2014 06:42:15 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-grid.js
r29073 r29074 154 154 155 155 createRouter: function() { 156 this.gridRouter = new media.view. Frame.Router( this);156 this.gridRouter = new media.view.MediaFrame.Manage.Router(); 157 157 158 158 // Verify pushState support and activate … … 336 336 * A router for handling the browser history and application state 337 337 */ 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({ 346 339 routes: { 347 340 'upload.php?item=:slug': 'showitem', … … 364 357 // Show the modal with a specific item 365 358 showitem: function( query ) { 366 var library = this.mediaFrame.state().get('library');359 var library = media.frame.state().get('library'); 367 360 368 361 // Remove existing modal if present 369 362 this.closeModal(); 370 363 // 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 ) } ) ); 372 365 }, 373 366 374 367 // Close the modal if set up 375 368 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(); 378 371 } 379 372 },
Note: See TracChangeset
for help on using the changeset viewer.