CoreFiles by mySites.guru
spinner.js38 lines, 622 bytes, from wordpress-4.2-beta2.zip
Raw History Compare with 4.2-beta1
md5
6dea009f0d4668c73cb669b1114e3412
sha1
31c88a0ec86fb19f693d5a87814d557af34be163
sha256
c26d40b668a8a90afa84b8d25e6cae7d4f1e7fab4db5ca5cba178d246c678f5b
/*globals _ */

/**
 * wp.media.view.Spinner
 *
 * @class
 * @augments wp.media.View
 * @augments wp.Backbone.View
 * @augments Backbone.View
 */
var View = require( './view.js' ),
	Spinner;

Spinner = 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;

The same content is in 3 releases, WordPress 4.2-beta1 to 4.2-beta3. See them all, or every version of this file.