CoreFiles by mySites.guru
spinner.js35 lines, 589 bytes, from wordpress-4.2-beta4.zip
Raw History Compare with 4.2-beta3
md5
95bb9b5a019f550ac56f163876362d37
sha1
b8b4751a7dc33b1a20dffd88d1b2ead333a4c986
sha256
57ed435d86452fa6b264bc7d8758dc2b4535778c95adec6ddd72b249aafd1941
/*globals _ */

/**
 * wp.media.view.Spinner
 *
 * @class
 * @augments wp.media.View
 * @augments wp.Backbone.View
 * @augments Backbone.View
 */
var Spinner = wp.media.View.extend({
	tagName:   'span',
	className: 'spinner',
	spinnerTimeout: false,
	delay: 400,

	show: function() {
		if ( ! this.spinnerTimeout ) {
			this.spinnerTimeout = _.delay(function( $el ) {
				$el.show();
			}, this.delay, this.$el );
		}

		return this;
	},

	hide: function() {
		this.$el.hide();
		this.spinnerTimeout = clearTimeout( this.spinnerTimeout );

		return this;
	}
});

module.exports = Spinner;

No other release has this exact content. See every version of this file.