src/js/widgets/tooltipWidget.js
branchpopcorn-port
changeset 474 c1998d5d552e
parent 336 8da13562cfea
child 477 1e51d638e7ea
--- a/src/js/widgets/tooltipWidget.js	Fri Dec 16 16:23:59 2011 +0100
+++ b/src/js/widgets/tooltipWidget.js	Fri Dec 16 18:16:23 2011 +0100
@@ -1,6 +1,7 @@
 /* this widget displays a small tooltip */
 IriSP.TooltipWidget = function(Popcorn, config, Serializer) {
   IriSP.Widget.call(this, Popcorn, config, Serializer);
+  this._shown = false;
 };
 
 
@@ -19,15 +20,19 @@
 };
 
 IriSP.TooltipWidget.prototype.show = function(text, color, x, y) {
-  if (this.selector.find(".tiptext").text() == text)
+  if (this._shown === true || this.selector.find(".tiptext").text() == text)
     return;
 
   this.selector.find(".tipcolor").css("background-color", color);
 	this.selector.find(".tiptext").text(text);
   this.selector.find(".tip").css("left", x).css("top", y);
+  
+  this._shown = true;
 };
 
 IriSP.TooltipWidget.prototype.hide = function() {
   this.clear();
   this.selector.find(".tip").css("left", -10000).css("top", -100000);
+  
+  this._shown = false;
 };