close popup editor as soon as the node get hidden again
authorrougeronj
Fri, 18 Sep 2015 15:37:50 +0200
changeset 531 78107f172e2a
parent 530 9823b527c3a1
child 532 030f2e4c0664
close popup editor as soon as the node get hidden again clean title text to remove html and keep only the text
client/js/renderer/noderepr.js
--- a/client/js/renderer/noderepr.js	Fri Sep 18 15:36:46 2015 +0200
+++ b/client/js/renderer/noderepr.js	Fri Sep 18 15:37:50 2015 +0200
@@ -143,7 +143,14 @@
 
             this.circle.opacity = this.options.show_node_circles ? opacity : 0.01;
 
-            var _text = this.model.get("title") || this.renkan.translate(this.options.label_untitled_nodes) || "";
+            
+            //strip html from title
+            var html = this.model.get("title");
+            var div = document.createElement("div");
+            div.innerHTML = html;
+            var clean_title = div.textContent || div.innerText || "";
+            
+            var _text = clean_title || this.renkan.translate(this.options.label_untitled_nodes) || "";
             _text = Utils.shortenText(_text, this.options.node_label_max_length);
 
             if (typeof this.highlighted === "object") {
@@ -408,6 +415,7 @@
                 }
                 //when the mouse don't hover the node anymore, we hide it
                 if (this.hidden) {
+                    this.renderer.removeRepresentationsOfType("editor");
                     this.hide();
                 }
                 else {