src/js/widgets/tooltipWidget.js
branchpopcorn-port
changeset 172 3ffa0e0c8803
child 177 69b14f35e900
equal deleted inserted replaced
171:158f0193ec54 172:3ffa0e0c8803
       
     1 /* this widget displays a small tooltip */
       
     2 IriSP.TooltipWidget = function(Popcorn, config, Serializer) {
       
     3   IriSP.Widget.call(this, Popcorn, config, Serializer);  
       
     4 };
       
     5 
       
     6 
       
     7 IriSP.TooltipWidget.prototype = new IriSP.Widget();
       
     8 
       
     9 IriSP.TooltipWidget.prototype.draw = function() {
       
    10   var templ = Mustache.to_html(IriSP.tooltipWidget_template);
       
    11   this.selector.append(templ);
       
    12   this.hide();
       
    13   
       
    14 };
       
    15 
       
    16 IriSP.TooltipWidget.prototype.show = function(text, color, x, y) {
       
    17   this.selector.children(".tipcolor").css("background-color", color);
       
    18 	this.selector.find(".tiptext").text(text);
       
    19   this.selector.children(".tip").css("left", x).css("top", y);
       
    20 };
       
    21 
       
    22 IriSP.TooltipWidget.prototype.hide = function() {
       
    23   this.selector.children(".tip").css("left", -10000).css("top", -100000);
       
    24 };