Elgg  Version 2.2
Functions
spinner.js File Reference

Go to the source code of this file.

Functions

 define (function(require){var $=require('jquery');var active=false;var SHOW_DELAY=20;$('body').append('< div class="elgg-spinner">< div class="elgg-ajax-loader"></div >< div class="elgg-spinner-text elgg-subtext"></div ></div >');var spinner={start:function(text){active=true;spinner.clearText();setTimeout(function(){if(active){$('body').addClass('elgg-spinner-active');$(spinner).triggerHandler('_testing_show');}}, SHOW_DELAY);if(typeof text=== 'string'){spinner.setText(text);}else{spinner.setText('');}}, stop:function(){active=false;$('body').removeClass('elgg-spinner-active');}, setText:function(text){$('.elgg-spinner.elgg-spinner-text').text(text);}, clearText:function(){$('.elgg-spinner.elgg-spinner-text').html('');}};return spinner;})
 

Function Documentation

define ( function(require){var $=require('jquery');var active=false;var SHOW_DELAY=20;$('body').append('< div class="elgg-spinner">< div class="elgg-ajax-loader"></div >< div class="elgg-spinner-text elgg-subtext"></div ></div >');var spinner={start:function(text){active=true;spinner.clearText();setTimeout(function(){if(active){$('body').addClass('elgg-spinner-active');$(spinner).triggerHandler('_testing_show');}}, SHOW_DELAY);if(typeof text=== 'string'){spinner.setText(text);}else{spinner.setText('');}}, stop:function(){active=false;$('body').removeClass('elgg-spinner-active');}, setText:function(text){$('.elgg-spinner.elgg-spinner-text').text(text);}, clearText:function(){$('.elgg-spinner.elgg-spinner-text').html('');}};return spinner;}  )
Parameters
function(require){var$=require('jquery');var active=false;var SHOW_DELAY=20;$('body').append('< div class="elgg-spinner">< div class="elgg-ajax-loader">< div class="elgg-spinner-text elgg-subtext">');var spinner={start:function(text){active=true;spinner.clearText();setTimeout(function(){if(active){$('body').addClass('elgg-spinner-active');.triggerHandler('_testing_show');}}, SHOW_DELAY);if(typeof text=== 'string'){spinner.setText(text);}else{spinner.setText('');}}, stop:function(){active=false;$('body').removeClass('elgg-spinner-active');}, setText:function(text){$('.elgg-spinner.elgg-spinner-text').text(text);}, clearText:function(){$('.elgg-spinner.elgg-spinner-text').html('');}};return spinner;} Activate the spinner (will appear after 20ms).
{String}text Text to display below spinner (will be escaped)

Deactivate the spinner

Set the text on a displayed spinner.

Parameters
{String}text Text to display below spinner (will be escaped)

Remove the text on a displayed spinner.