Stackedit/res/extensions/workingIndicator.js
2013-08-26 06:58:18 +02:00

23 lines
617 B
JavaScript

define([
"jquery",
"underscore",
"classes/Extension",
], function($, _, Extension) {
var workingIndicator = new Extension("workingIndicator", "Working Indicator");
var $bodyElt = undefined;
var $workingIndicatorElt = undefined;
workingIndicator.onAsyncRunning = function(isRunning) {
$bodyElt.toggleClass("working", isRunning);
$workingIndicatorElt.toggleClass("show", isRunning);
};
workingIndicator.onReady = function() {
$bodyElt = $(document.body);
$workingIndicatorElt = $(".working-indicator");
};
return workingIndicator;
});