diff -r de1e7cf6bfc4 -r 7253d4d06f0d src/widgets/Tooltip.js --- a/src/widgets/Tooltip.js Fri Oct 25 01:32:13 2013 +0200 +++ b/src/widgets/Tooltip.js Thu Jan 02 16:54:22 2014 +0100 @@ -28,7 +28,7 @@ this.$tip = this.$.find(".Ldt-Tooltip-Tip"); this.$sw = this.$.find(".Ldt-Tooltip-Border-SW"); this.$se = this.$.find(".Ldt-Tooltip-Border-SE"); - this.__halfWidth = Math.floor(this.$.find(".Ldt-Tooltip-Main").width()/2); + this.__halfWidth = Math.floor(( this.$.find(".Ldt-Tooltip-Main").width() || 192)/2); this.__borderWidth = this.$.find(".Ldt-Tooltip-Border-Left").width(); this.__tipDelta = this.__halfWidth - Math.floor(this.$tip.width()/2); this.__maxShift = this.__tipDelta - this.__borderWidth; @@ -41,7 +41,21 @@ IriSP.Widgets.Tooltip.prototype.show = function(x, y, text, color) { if (typeof color !== "undefined") { - this.$.find(".Ldt-Tooltip-Color").show().css("background-color", color); + // one color or array of colors + if (typeof color === "string") { + this.$.find(".Ldt-Tooltip-Color").html(""); + this.$.find(".Ldt-Tooltip-Color").show().css("background-color", color); + this.$.find(".Ldt-Tooltip-Color").show().css("height", ""); + } + else{ + var d = this.$.find(".Ldt-Tooltip-Color"); + d.html(""); + d.show(); + for(var i=0; i') + } + this.$.find(".Ldt-Tooltip-Color").css("height", (color.length * 10) + "px"); + } } else { this.$.find(".Ldt-Tooltip-Color").hide(); }