Changeset 27516
- Timestamp:
- 03/12/2014 09:06:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-views.js
r27498 r27516 5206 5206 5207 5207 scroll: function() { 5208 var view = this, 5209 toolbar; 5210 5208 5211 // @todo: is this still necessary? 5209 5212 if ( ! this.$el.is(':visible') ) { … … 5212 5215 5213 5216 if ( this.collection.hasMore() && this.el.scrollHeight < this.el.scrollTop + ( this.el.clientHeight * this.options.refreshThreshold ) ) { 5214 this.collection.more().done( this.scroll ); 5217 toolbar = this.views.parent.toolbar; 5218 toolbar.get('spinner').show(); 5219 5220 this.collection.more().done(function() { 5221 view.scroll(); 5222 toolbar.get('spinner').hide(); 5223 }); 5215 5224 } 5216 5225 } … … 5452 5461 this.collection.on( 'add remove reset', this.updateContent, this ); 5453 5462 }, 5454 toggleSpinner: function( state ) {5455 if ( state ) {5456 this.spinnerTimeout = _.delay(function( view ) {5457 view.toolbar.get( 'spinner' ).show();5458 }, 600, this );5459 } else {5460 this.toolbar.get( 'spinner' ).hide();5461 clearTimeout( this.spinnerTimeout );5462 }5463 },5464 5463 /** 5465 5464 * @returns {wp.media.view.AttachmentsBrowser} Returns itself to allow chaining … … 5526 5525 5527 5526 if ( ! this.collection.length ) { 5528 this.to ggleSpinner( true);5527 this.toolbar.get( 'spinner' ).show(); 5529 5528 this.collection.more().done(function() { 5530 5529 if ( ! view.collection.length ) { 5531 5530 view.createUploader(); 5532 5531 } 5533 view.to ggleSpinner( false);5532 view.toolbar.get( 'spinner' ).hide(); 5534 5533 }); 5535 5534 } … … 6765 6764 tagName: 'span', 6766 6765 className: 'spinner', 6766 spinnerTimeout: false, 6767 delay: 400, 6767 6768 6768 6769 show: function() { 6769 this.$el.show(); 6770 if ( ! this.spinnerTimeout ) { 6771 this.spinnerTimeout = _.delay(function( $el ) { 6772 $el.show(); 6773 }, this.delay, this.$el ); 6774 } 6775 6770 6776 return this; 6771 6777 }, … … 6773 6779 hide: function() { 6774 6780 this.$el.hide(); 6781 this.spinnerTimeout = clearTimeout( this.spinnerTimeout ); 6782 6775 6783 return this; 6776 6784 }
Note: See TracChangeset
for help on using the changeset viewer.