client/annotviz/app/js/annotsroll.js
changeset 122 3b11017a76a4
parent 120 89544c28a364
child 123 d8ef840eaf68
--- a/client/annotviz/app/js/annotsroll.js	Thu Jan 22 15:03:58 2015 +0100
+++ b/client/annotviz/app/js/annotsroll.js	Thu Jan 22 15:49:07 2015 +0100
@@ -78,7 +78,7 @@
             text     = data.content.text,
             user     = data.content.user,
             ts       = Date.parse(data.ts),
-            color    = this.getColor(ts, data.content.category.code);
+            color    = data.content.color || this.getColor(ts, data.content.category.code);
 
         this.addAnnot(category, text, user, color, ts);
     };
@@ -96,14 +96,13 @@
             resColor = colorsDef[code];
         }
         if(!resColor) {
-            resColor = DEFAULT_ANNOT_COLOR;
+            resColor = this.annotColors[0].defaultColor || DEFAULT_ANNOT_COLOR;
         }
         return resColor;
     }
 
-    this.addAnnot = function(category, text, user, catColor, ts){
+    this.addAnnot = function(category, text, user, color, ts){
 
-        var color = catColor ? catColor : DEFAULT_ANNOT_COLOR;
         var x = 0;
         var y = (ts-this.startTs) * this.pixelsPerSecond / 1000 + yInit;