Changeset 29420
- Timestamp:
- 08/06/2014 09:43:26 PM (11 years ago)
- Location:
- trunk/src/wp-includes/js
- Files:
-
- 2 edited
-
media-grid.js (modified) (4 diffs)
-
media-views.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-grid.js
r29415 r29420 92 92 } 93 93 94 this.gridRouter = new media.view.MediaFrame.Manage.Router(); 95 94 96 // Call 'initialize' directly on the parent class. 95 97 media.view.MediaFrame.prototype.initialize.apply( this, arguments ); … … 110 112 self.gridRouter.navigate( self.gridRouter.baseUrl( url ) ); 111 113 }, 1000 ) ); 112 113 // This is problematic.114 _.delay( _.bind( this.createRouter, this ), 1000 );115 },116 117 createRouter: function() {118 this.gridRouter = new media.view.MediaFrame.Manage.Router();119 120 // Verify pushState support and activate121 if ( window.history && window.history.pushState ) {122 Backbone.history.start({123 root: _wpMediaGridSettings.adminUrl,124 pushState: true125 });126 }127 114 }, 128 115 … … 211 198 scrollElement: document 212 199 }); 200 this.browserView.on( 'ready', _.bind( this.bindDeferred, this ) ); 213 201 214 202 this.errors = wp.Uploader.errors; … … 218 206 sidebarVisibility: function() { 219 207 this.browserView.$( '.media-sidebar' ).toggle( this.errors.length ); 208 }, 209 210 bindDeferred: function() { 211 this.browserView.dfd.done( _.bind( this.startHistory, this ) ); 212 }, 213 214 startHistory: function() { 215 // Verify pushState support and activate 216 if ( window.history && window.history.pushState ) { 217 Backbone.history.start( { 218 root: _wpMediaGridSettings.adminUrl, 219 pushState: true 220 } ); 221 } 220 222 } 221 223 }); -
trunk/src/wp-includes/js/media-views.js
r29415 r29420 5820 5820 if ( ! this.collection.length ) { 5821 5821 this.toolbar.get( 'spinner' ).show(); 5822 this. collection.more().done(function() {5822 this.dfd = this.collection.more().done( function() { 5823 5823 if ( ! view.collection.length ) { 5824 5824 noItemsView.$el.removeClass( 'hidden' ); … … 5827 5827 } 5828 5828 view.toolbar.get( 'spinner' ).hide(); 5829 } );5829 } ); 5830 5830 } else { 5831 5831 noItemsView.$el.addClass( 'hidden' );
Note: See TracChangeset
for help on using the changeset viewer.