]> arthur.barton.de Git - netdata.git/commitdiff
fix for user supplied colors; fixes #1084
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 7 Oct 2016 21:18:45 +0000 (00:18 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 7 Oct 2016 21:18:45 +0000 (00:18 +0300)
web/dashboard.js

index 7395088a2bd012332be1836aac67fe903fdc8c08..d2122ce8272f35636a131f29a67fa689f8471532 100644 (file)
 
             this.colors = new Array();
             this.colors_available = new Array();
-            var i, len;
 
+            // add the standard colors
+            var len = NETDATA.themes.current.colors.length;
+            while(len--)
+                this.colors_available.unshift(NETDATA.themes.current.colors[len]);
+
+            // add the user supplied colors
             var c = $(this.element).data('colors');
             // this.log('read colors: ' + c);
             if(typeof c !== 'undefined' && c !== null && c.length > 0) {
                         while(len--) {
                             added++;
                             this.colors_available.unshift(c[len]);
-                            // this.log('adding color: ' + c[i]);
+                            // this.log('adding color: ' + c[len]);
                         }
                     }
                 }
             }
 
-            // push all the standard colors too
-            len = NETDATA.themes.current.colors.length;
-            while(len--)
-                this.colors_available.unshift(NETDATA.themes.current.colors[len]);
-
             return this.colors;
         };