Docs: Improve JSDoc for `media/views/spinner.js`.

Props avillegasn.
Fixes #43230.


git-svn-id: https://develop.svn.wordpress.org/trunk@42675 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Anton Timmermans 2018-02-09 14:31:18 +00:00
parent 31816ccec2
commit 6e125f017e
1 changed files with 18 additions and 0 deletions

View File

@ -1,6 +1,10 @@
/**
* wp.media.view.Spinner
*
* Represents a spinner in the Media Library.
*
* @since 3.9.0
*
* @memberOf wp.media.view
*
* @class
@ -14,6 +18,13 @@ var Spinner = wp.media.View.extend(/** @lends wp.media.view.Spinner.prototype */
spinnerTimeout: false,
delay: 400,
/**
* Shows the spinner. Delays the visibility by the configured amount.
*
* @since 3.9.0
*
* @return {wp.media.view.Spinner} The spinner.
*/
show: function() {
if ( ! this.spinnerTimeout ) {
this.spinnerTimeout = _.delay(function( $el ) {
@ -24,6 +35,13 @@ var Spinner = wp.media.View.extend(/** @lends wp.media.view.Spinner.prototype */
return this;
},
/**
* Hides the spinner.
*
* @since 3.9.0
*
* @return {wp.media.view.Spinner} The spinner.
*/
hide: function() {
this.$el.removeClass( 'is-active' );
this.spinnerTimeout = clearTimeout( this.spinnerTimeout );