All files icons.js

100% Statements 5/5
100% Branches 2/2
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37  1x 1x                         1x                       1x   1x              
var
	Icon = require( './Icon' ),
	util = require( './util' );
 
/**
 * A set of shared icons.
 *
 * Factory methods are used to keep separate features that use the same icons
 * from accidentally manipulating one another's DOM when calling methods like
 * `remove`.
 *
 * @class icons
 * @singleton
 * @uses Icon
 */
module.exports = {
	/**
	 * Gets a spinner icon.
	 *
	 * The icon should be used to inform the user that the front-end is
	 * communicating with the back-end.
	 * @memberof icons
	 * @instance
	 * @param {Object} [options] See `Icon` for more details
	 * @return {Icon}
	 */
	spinner: function ( options ) {
		options = options || {};
 
		return new Icon( util.extend( options, {
			name: 'spinner',
			label: mw.msg( 'mobile-frontend-loading-message' ),
			additionalClassNames: 'spinner loading'
		} ) );
	}
};