mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-31 07:49:38 +01:00
9737acc1a5
See #28510. Built from https://develop.svn.wordpress.org/trunk@31491 git-svn-id: http://core.svn.wordpress.org/trunk@31472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
39 lines
622 B
JavaScript
39 lines
622 B
JavaScript
/*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;
|