client/js/renderer/noderepr.js
changeset 649 2b9c120dba55
parent 600 e12243191095
--- a/client/js/renderer/noderepr.js	Thu Jan 05 19:34:53 2017 +0100
+++ b/client/js/renderer/noderepr.js	Tue Jan 10 17:36:30 2017 +0100
@@ -153,12 +153,34 @@
             var _text = clean_title || this.renkan.translate(this.options.label_untitled_nodes) || "";
             _text = Utils.shortenText(_text, this.options.node_label_max_length);
 
+            //_formatedText = _text;
+
+
             if (typeof this.highlighted === "object") {
-                this.title.html(this.highlighted.replace(_(_text).escape(),'<span class="Rk-Highlighted">$1</span>'));
-            } else {
-                this.title.text(_text);
+                _text = this.highlighted.replace(_(_text).escape(),'<span class="Rk-Highlighted">$1</span>');
             }
 
+            //TODO: default text node color
+            var node_style = (this.model.get("style") || {'title_size': 1, 'title-color': '#00000' });
+            var text_size = node_style.title_size || 1;
+            var text_color = node_style.title_color || this.options.node_title_color;
+
+            var text_style = {
+                'line-height': "1em"
+            };
+
+            if(text_size !== 1) {
+                text_style['font-size'] = text_size.toFixed(1)+"em";
+            }
+            //TODO: compare with default value
+            if(text_color !== "#000000") {
+                text_style.color = text_color;
+            }
+
+            var text_node = $("<span>").css(text_style).html(_text);
+
+            this.title.empty().append(text_node);
+
             var _strokeWidth = this._getStrokeWidth();
             this.title.css({
                 left: this.paper_coords.x,