fix for user supplied colors; fixes #1084
Costa Tsaousis (ktsaou) committed
Oct 8, 2016 at 00:18 UTC
2b1c771f5199491e7e579980657d40071816d6d0
1 file changed
+7
-7
web/dashboard.js
+7
-7
@@ -2200,8 +2200,13 @@
2200
2201
this.colors = new Array();
2202
this.colors_available = new Array();
2203
- var i, len;
2203
2204
+ // add the standard colors
2205
+ var len = NETDATA.themes.current.colors.length;
2206
+ while(len--)
2207
+ this.colors_available.unshift(NETDATA.themes.current.colors[len]);
2208
+
2209
+ // add the user supplied colors
2210
var c = $(this.element).data('colors');
2211
// this.log('read colors: ' + c);
2212
if(typeof c !== 'undefined' && c !== null && c.length > 0) {
@@ -2217,17 +2222,12 @@
2222
while(len--) {
2223
added++;
2224
this.colors_available.unshift(c[len]);
2220
- // this.log('adding color: ' + c[i]);
2225
+ // this.log('adding color: ' + c[len]);
2226
}
2227
}
2228
}
2229
}
2230
2226
- // push all the standard colors too
2227
- len = NETDATA.themes.current.colors.length;
2228
- while(len--)
2229
- this.colors_available.unshift(NETDATA.themes.current.colors[len]);
2230
-
2231
return this.colors;
2232
};
2233