truncate the text if it's too long. cap-demo
authorhamidouk
Mon, 05 Dec 2011 15:53:30 +0100
branchcap-demo
changeset 409 aa08a47b3dbb
parent 408 ed1f164061a7
child 410 de8fdd68930f
truncate the text if it's too long.
src/js/widgets/tooltipWidget.js
--- a/src/js/widgets/tooltipWidget.js	Mon Dec 05 15:44:18 2011 +0100
+++ b/src/js/widgets/tooltipWidget.js	Mon Dec 05 15:53:30 2011 +0100
@@ -22,6 +22,9 @@
   if (this.selector.find(".tiptext").text() == text)
     return;
 
+  if(text.length > 120)
+    text = text.slice(0,119) + "...";
+
   this.selector.find(".tipcolor").css("background-color", color);
 	this.selector.find(".tiptext").text(text);
   this.selector.find(".tip").css("left", x).css("top", y);