# HG changeset patch # User hamidouk # Date 1321269387 -3600 # Node ID accc7358d8b5fd8db6f5e48dd08e757869b0cf30 # Parent 53d8d95a007900ba68d44e530d66cab3b08ad8dc fixed a position bug. diff -r 53d8d95a0079 -r accc7358d8b5 src/css/LdtPlayer.css --- a/src/css/LdtPlayer.css Thu Nov 10 17:25:30 2011 +0100 +++ b/src/css/LdtPlayer.css Mon Nov 14 12:16:27 2011 +0100 @@ -183,7 +183,8 @@ } .tip{ - position : absolute; + position : fixed; /* why not absolute instead of fixed ? because the div containing the tooltip widget is not a subdiv of its parent + widget */ padding : 3px; z-index: 10000000000; max-width: 200px; @@ -196,7 +197,6 @@ padding-top: 15px; padding-right: 15px; color: black; - z-index: 10000000000; font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; overflow:hidden; } diff -r 53d8d95a0079 -r accc7358d8b5 src/js/widgets/polemicWidget.js --- a/src/js/widgets/polemicWidget.js Thu Nov 10 17:25:30 2011 +0100 +++ b/src/js/widgets/polemicWidget.js Mon Nov 14 12:16:27 2011 +0100 @@ -275,11 +275,11 @@ e.time= frames[i].mytweetsID[k].timeframe; e.title= frames[i].mytweetsID[k].title; - e.mouseover(function(element) { return function (event) { - - // event.clientX and event.clientY are to raphael what event.pageX and pageY are to jquery. + e.mouseover(function(element) { return function (event) { + // event.clientX and event.clientY are to raphael what event.pageX and pageY are to jquery. self.TooltipWidget.show.call(self.TooltipWidget, element.title, element.attr("fill"), event.clientX - 106, event.clientY - 160); element.displayed = true; + debugger; }}(e)).mouseout(function(element) { return function () { self.TooltipWidget.hide.call(self.TooltipWidget); }}(e)).mousedown(function () { diff -r 53d8d95a0079 -r accc7358d8b5 src/js/widgets/tooltipWidget.js --- a/src/js/widgets/tooltipWidget.js Thu Nov 10 17:25:30 2011 +0100 +++ b/src/js/widgets/tooltipWidget.js Mon Nov 14 12:16:27 2011 +0100 @@ -8,6 +8,7 @@ IriSP.TooltipWidget.prototype.draw = function() { var templ = Mustache.to_html(IriSP.tooltipWidget_template); + this.selector.append(templ); this.hide(); diff -r 53d8d95a0079 -r accc7358d8b5 unittests/tests/tooltipWidget.js --- a/unittests/tests/tooltipWidget.js Thu Nov 10 17:25:30 2011 +0100 +++ b/unittests/tests/tooltipWidget.js Mon Nov 14 12:16:27 2011 +0100 @@ -26,6 +26,7 @@ widget.draw(); equal(widget.selector.children(".tip").length, 1, "test if the div has been added correctly"); + equal(widget.selector.children(".tip").css("position"), "fixed", "test if the widget has the correct position attr"); equal(widget.selector.children(".tip").css("left"), "-10000px", "test if div has been positionned correctly"); equal(widget.selector.children(".tip").css("top"), "-100000px", "test if div has been positionned correctly"); }); @@ -38,7 +39,7 @@ equal(widget.selector.children(".tip").css("left"), "105px", "test if div has been positionned correctly"); equal(widget.selector.children(".tip").css("top"), "240px", "test if div has been positionned correctly"); equal(widget.selector.find(".tiptext").text(), "ceci est un texte", "test if text has been set correctly"); - + widget.hide(); equal(widget.selector.children(".tip").css("left"), "-10000px", "test if div has been positionned correctly"); equal(widget.selector.children(".tip").css("top"), "-100000px", "test if div has been positionned correctly");