web/lib/metadataplayer/Tooltip.js
changeset 51 418a12ee972f
parent 0 7f8907368bd5
equal deleted inserted replaced
50:73ade123e5c1 51:418a12ee972f
    39 };
    39 };
    40 
    40 
    41 IriSP.Widgets.Tooltip.prototype.show = function(x, y, text, color) {
    41 IriSP.Widgets.Tooltip.prototype.show = function(x, y, text, color) {
    42     
    42     
    43     if (typeof color !== "undefined") {
    43     if (typeof color !== "undefined") {
    44         this.$.find(".Ldt-Tooltip-Color").show().css("background-color", color);
    44     	// one color or array of colors
       
    45     	if (typeof color === "string") {
       
    46     		this.$.find(".Ldt-Tooltip-Color").html("");
       
    47     		this.$.find(".Ldt-Tooltip-Color").show().css("background-color", color);
       
    48     		this.$.find(".Ldt-Tooltip-Color").show().css("height", "");
       
    49     	}
       
    50     	else{
       
    51     		var d = this.$.find(".Ldt-Tooltip-Color");
       
    52     		d.html("");
       
    53     		d.show();
       
    54     		for(var i=0; i<color.length; i++){
       
    55     			d.append('<div style="float: left; height: 10px; width: 10px; background-color: ' + color[i] + '">')
       
    56     		}
       
    57     		this.$.find(".Ldt-Tooltip-Color").css("height", (color.length * 10) + "px");
       
    58     	}
    45     } else {
    59     } else {
    46         this.$.find(".Ldt-Tooltip-Color").hide();
    60         this.$.find(".Ldt-Tooltip-Color").hide();
    47     }
    61     }
    48 
    62 
    49     this.$.find(".Ldt-Tooltip-Text").html(text);
    63     this.$.find(".Ldt-Tooltip-Text").html(text);