summaryrefslogtreecommitdiff
path: root/jrrd.js
diff options
context:
space:
mode:
authorRichard Wall <richard@aziz>2010-04-18 11:56:25 +0100
committerRichard Wall <richard@aziz>2010-04-18 11:56:25 +0100
commit3f5e6bd8eaeba9a67cc21f13bf536562d44b756b (patch)
tree3df2da8b444a05685fd39abc2775eaa341276228 /jrrd.js
parentf1844830498d1972e7989b8b603d20d0f7b1378a (diff)
Add loading icons
Diffstat (limited to 'jrrd.js')
-rw-r--r--jrrd.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/jrrd.js b/jrrd.js
index a3b2464..95d078d 100644
--- a/jrrd.js
+++ b/jrrd.js
@@ -243,12 +243,17 @@ jrrd.Chart.prototype.setTimeRange = function(startTime, endTime) {
}
jrrd.Chart.prototype.draw = function() {
+ this.template.trigger('chart_loading');
var result;
var results = [];
for(var i=0; i<this.data.length; i++) {
if(this.data[i][2]) {
result = this.data[i][1].getData(this.startTime, this.endTime);
} else {
+ // If the data source has been marked as disabled return a fake
+ // empty dataset
+ // 0 values so that it can contribute to a stacked chart.
+ // 0 linewidth so that it doesn't cause a line in stacked chart
result = new MochiKit.Async.Deferred();
result.callback({
data: [
@@ -275,6 +280,11 @@ jrrd.Chart.prototype.draw = function() {
.addErrback(
function(self, failure) {
self.template.text('error: ' + failure.message);
+ }, this)
+ .addBoth(
+ function(self, res) {
+ self.template.trigger('chart_loaded');
+ return res;
}, this);
};