Changeset 27438
- Timestamp:
- 03/06/2014 05:45:26 PM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/css/media-views.css
r27411 r27438 1291 1291 } 1292 1292 1293 .media-toolbar .spinner { 1294 margin-top: 14px; 1295 } 1296 1293 1297 .media-sidebar .settings-save-status { 1294 1298 background: #f5f5f5; -
trunk/src/wp-includes/js/media-views.js
r27435 r27438 5255 5255 this.collection.on( 'add remove reset', this.updateContent, this ); 5256 5256 }, 5257 toggleSpinner: function( state ) { 5258 if ( state ) { 5259 this.spinnerTimeout = _.delay(function( view ) { 5260 view.toolbar.get( 'spinner' ).show(); 5261 }, 600, this ); 5262 } else { 5263 this.toolbar.get( 'spinner' ).hide(); 5264 clearTimeout( this.spinnerTimeout ); 5265 } 5266 }, 5257 5267 /** 5258 5268 * @returns {wp.media.view.AttachmentsBrowser} Returns itself to allow chaining … … 5291 5301 } 5292 5302 5303 this.toolbar.set( 'spinner', new media.view.Spinner({ 5304 priority: -70 5305 }) ); 5306 5293 5307 if ( this.options.search ) { 5294 5308 this.toolbar.set( 'search', new media.view.Search({ … … 5315 5329 5316 5330 if ( ! this.collection.length ) { 5317 this.collection.more().done( function() { 5331 this.toggleSpinner( true ); 5332 this.collection.more().done(function() { 5318 5333 if ( ! view.collection.length ) { 5319 5334 view.createUploader(); 5320 5335 } 5336 view.toggleSpinner( false ); 5321 5337 }); 5322 5338 } … … 6314 6330 } 6315 6331 }); 6332 6333 /** 6334 * wp.media.view.Spinner 6335 * 6336 * @constructor 6337 * @augments wp.media.View 6338 * @augments wp.Backbone.View 6339 * @augments Backbone.View 6340 */ 6341 media.view.Spinner = media.View.extend({ 6342 tagName: 'span', 6343 className: 'spinner', 6344 6345 show: function() { 6346 this.$el.show(); 6347 return this; 6348 }, 6349 6350 hide: function() { 6351 this.$el.hide(); 6352 return this; 6353 } 6354 }); 6316 6355 }(jQuery, _));
Note: See TracChangeset
for help on using the changeset viewer.