Elgg  Version 2.2
spinner.js
Go to the documentation of this file.
1 define(function (require) {
2  var $ = require('jquery');
3 
4  var active = false;
5  var SHOW_DELAY = 20;
6 
7  $('body').append('<div class="elgg-spinner"><div class="elgg-ajax-loader"></div><div class="elgg-spinner-text elgg-subtext"></div></div>');
8 
9  var spinner = {
15  start: function (text) {
16  active = true;
17 
18  spinner.clearText();
19 
20  setTimeout(function () {
21  if (active) {
22  $('body').addClass('elgg-spinner-active');
23  $(spinner).triggerHandler('_testing_show');
24  }
25  }, SHOW_DELAY);
26 
27  if (typeof text === 'string') {
28  spinner.setText(text);
29  } else {
30  spinner.setText('');
31  }
32  },
33 
37  stop: function () {
38  active = false;
39  $('body').removeClass('elgg-spinner-active');
40  },
41 
47  setText: function (text) {
48  $('.elgg-spinner .elgg-spinner-text').text(text);
49  },
50 
54  clearText: function () {
55  $('.elgg-spinner .elgg-spinner-text').html('');
56  }
57  };
58 
59  return spinner;
60 });
ui datepicker calendar ui state active
Definition: admin.css.php:666
html
Definition: admin.css.php:36
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;})
elgg require
Throw an error if the required package isn&#39;t present.
Definition: elgglib.js:164
elgg input text
Definition: admin.css.php:505