diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js
index 76f689b..fc282c3 100644
a
|
b
|
|
5361 | 5361 | |
5362 | 5362 | this.collection.on( 'add remove reset', this.updateContent, this ); |
5363 | 5363 | }, |
5364 | | toggleSpinner: function( state ) { |
5365 | | if ( state ) { |
5366 | | this.spinnerTimeout = _.delay(function( view ) { |
5367 | | view.toolbar.get( 'spinner' ).show(); |
5368 | | }, 600, this ); |
5369 | | } else { |
5370 | | this.toolbar.get( 'spinner' ).hide(); |
5371 | | clearTimeout( this.spinnerTimeout ); |
5372 | | } |
5373 | | }, |
5374 | 5364 | /** |
5375 | 5365 | * @returns {wp.media.view.AttachmentsBrowser} Returns itself to allow chaining |
5376 | 5366 | */ |
… |
… |
|
5435 | 5425 | } |
5436 | 5426 | |
5437 | 5427 | if ( ! this.collection.length ) { |
5438 | | this.toggleSpinner( true ); |
| 5428 | this.toolbar.get( 'spinner' ).show(); |
5439 | 5429 | this.collection.more().done(function() { |
5440 | 5430 | if ( ! view.collection.length ) { |
5441 | 5431 | view.createUploader(); |
5442 | 5432 | } |
5443 | | view.toggleSpinner( false ); |
| 5433 | view.toolbar.get( 'spinner' ).hide(); |
5444 | 5434 | }); |
5445 | 5435 | } |
5446 | 5436 | }, |
… |
… |
|
6579 | 6569 | className: 'spinner', |
6580 | 6570 | |
6581 | 6571 | show: function() { |
6582 | | this.$el.show(); |
| 6572 | this.spinnerTimeout = _.delay(function( $el ) { |
| 6573 | $el.show(); |
| 6574 | }, 300, this.$el ); |
| 6575 | |
6583 | 6576 | return this; |
6584 | 6577 | }, |
6585 | 6578 | |
6586 | 6579 | hide: function() { |
6587 | 6580 | this.$el.hide(); |
| 6581 | clearTimeout( this.spinnerTimeout ); |
| 6582 | |
6588 | 6583 | return this; |
6589 | 6584 | } |
6590 | 6585 | }); |