Stackedit/res/extensions/workingIndicator.js

23 lines
617 B
JavaScript
Raw Normal View History

2013-05-27 19:45:33 +00:00
define([
2013-05-29 19:55:23 +00:00
"jquery",
2013-06-22 23:48:57 +00:00
"underscore",
"classes/Extension",
], function($, _, Extension) {
2013-05-29 19:55:23 +00:00
2013-06-22 23:48:57 +00:00
var workingIndicator = new Extension("workingIndicator", "Working Indicator");
2013-05-29 19:55:23 +00:00
2013-08-22 00:19:59 +00:00
var $bodyElt = undefined;
var $workingIndicatorElt = undefined;
2013-05-29 19:55:23 +00:00
workingIndicator.onAsyncRunning = function(isRunning) {
2013-08-22 00:19:59 +00:00
$bodyElt.toggleClass("working", isRunning);
$workingIndicatorElt.toggleClass("show", isRunning);
};
workingIndicator.onReady = function() {
$bodyElt = $(document.body);
$workingIndicatorElt = $(".working-indicator");
2013-05-29 19:55:23 +00:00
};
return workingIndicator;
2013-05-27 19:45:33 +00:00
});