src/js/widgets/tooltipWidget.js
author hamidouk
Thu, 03 Nov 2011 13:07:33 +0100
branchpopcorn-port
changeset 173 3f83194517bf
parent 172 3ffa0e0c8803
child 177 69b14f35e900
permissions -rw-r--r--
changed the css to add the correct url to the image.

/* this widget displays a small tooltip */
IriSP.TooltipWidget = function(Popcorn, config, Serializer) {
  IriSP.Widget.call(this, Popcorn, config, Serializer);  
};


IriSP.TooltipWidget.prototype = new IriSP.Widget();

IriSP.TooltipWidget.prototype.draw = function() {
  var templ = Mustache.to_html(IriSP.tooltipWidget_template);
  this.selector.append(templ);
  this.hide();
  
};

IriSP.TooltipWidget.prototype.show = function(text, color, x, y) {
  this.selector.children(".tipcolor").css("background-color", color);
	this.selector.find(".tiptext").text(text);
  this.selector.children(".tip").css("left", x).css("top", y);
};

IriSP.TooltipWidget.prototype.hide = function() {
  this.selector.children(".tip").css("left", -10000).css("top", -100000);
};