diff -r 5135ccbf5a5f -r ec4f33084f8d metadataplayer edwin/metadataplayer/Tooltip.js --- a/metadataplayer edwin/metadataplayer/Tooltip.js Tue Oct 02 18:20:08 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* this widget displays a small tooltip */ -IriSP.Widgets.Tooltip = function(Popcorn, config, Serializer) { - IriSP.Widgets.Widget.call(this, Popcorn, config, Serializer); -}; - -IriSP.Widgets.Tooltip.prototype = new IriSP.Widgets.Widget(); - -IriSP.Widgets.Tooltip.prototype.template = '
'; - -IriSP.Widgets.Tooltip.prototype.draw = function() { - _this = this; - this.$.html(this.template); - this.$.parent().css({ - "position" : "relative" - }); - this.$tip = this.$.find(".Ldt-Tooltip"); - this.$.mouseover(function() { - _this.$tip.hide(); - }); - this.hide(); -}; - -IriSP.Widgets.Tooltip.prototype.show = function(x, y, text, color) { - - if (typeof color !== "undefined") { - this.$.find(".Ldt-Tooltip-Color").show().css("background-color", color); - } else { - this.$.find(".Ldt-Tooltip-Color").hide(); - } - - this.$.find(".Ldt-Tooltip-Text").html(text); - - this.$tip.show(); - this.$tip.css({ - "left" : Math.floor(x - this.$tip.outerWidth() / 2) + "px", - "top" : Math.floor(y - this.$tip.outerHeight()) + "px" - }); -}; - -IriSP.Widgets.Tooltip.prototype.hide = function() { - this.$tip.hide(); -};