Opened 13 years ago
Closed 9 years ago
#4721 closed defect (fixed)
dijit.MasterTooltip getting wrong position when connected to GFX objects
Reported by: | guest | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | 1.3 |
Component: | DojoX GFX | Version: | 0.9 |
Keywords: | tooltip gfx | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
Currently dijit.placeOnScreenAroundElement() is putting the MasterTooltip in the incorrect location, as seen in the below example (kudos to jayantbsai for example and for identifying this). The tooltip position gets set to style.top:-9999. I'm not sure if the problem is in dijit._MasterTooltip.show or in dijit.placeOnScreenAroundElement itself. Workaround is to just do a onmouseover event, correcting style={top: Xpx, left: Ypx};, but the tooltip flickers under this workaround since this is not really a good solution. My contact info is amcallis (at the domain] gmail:
Testcase:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="js/dojo/dijit/themes/tundra/tundra.css" type="text/css" rel="stylesheet" /> <title>GFX + Tooltip</title> <script type="text/javascript" djConfig="isDebug:true" src="js/dojo/dojo/dojo.js"></script> <script type="text/javascript"> dojo.require("dojox.gfx"); dojo.require("dojo.parser"); dojo.require("dijit.Tooltip"); function test() { var surface = dojox.gfx.createSurface(dojo.byId("div"), 300, 300); var shape = surface.createRect({ x:100, y:100, width:100, height:100 }).setFill([0, 255, 0]).setStroke({ color:[255, 0, 0], width:2 }); shape.getEventSource().id = "foo"; var tooltip = new dijit.Tooltip({ id:"label", connectId:"foo" }, "wordOfTheDay"); } dojo.addOnLoad(test); </script> </head> <body class="tundra"> <div id="div" style="width:300px; height:300px; border:1px solid #000; overflow:hidden;"></div> <span id="wordOfTheDay">longanimity</span> </body> </html>
Change History (13)
comment:1 Changed 13 years ago by
Milestone: | → 2.0 |
---|
comment:2 Changed 13 years ago by
Milestone: | 2.0 → 1.3 |
---|
comment:3 Changed 13 years ago by
Description: | modified (diff) |
---|
The code in the test case works only for DOM-based renderers (SVG, VML). It will not work for anything else.
comment:4 Changed 13 years ago by
Description: | modified (diff) |
---|
This ticket looks related to #6968. BTW, I'm fine w/rolling in the code from charting/action2d/Tooltip.js into place.js, so that placeAroundElement() works on a rectangle too, but that won't solve the whole problem. dijit.Tooltip isn't meant to work on GFX objects (out of the box) and not sure I want to add code for that into dijit.
comment:5 Changed 13 years ago by
Component: | Dijit → DojoX GFX |
---|---|
Owner: | set to Eugene Lazutkin |
Talked to Eugene about this. He's going to make a separate Tooltip widget for GFX, after making a few changes to dijit to make this easier, specifically splitting the current dijit.placeOnScreenAroundElement() into dijit.placeOnScreenAroundElement() and dijit._placeOnScreenAroundRect()... although let's first wait and see what things change because of #6968.
comment:6 Changed 13 years ago by
comment:7 Changed 13 years ago by
Consulted with Alex (#6968) --- he'll be happy with the rectangle object.
comment:8 Changed 13 years ago by
comment:9 Changed 13 years ago by
comment:10 Changed 13 years ago by
(In [14269]) Implementing the placement registry with AdapterRegistry? on Bill's suggestion. Refs #4721. !strict
comment:12 Changed 12 years ago by
Status: | new → assigned |
---|
comment:13 Changed 9 years ago by
Milestone: | future → 1.3 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
It seems like this is already fixed, and just didn't get closed. We have tooltips on charts now, as an example. Please reopen if there's still an issue. See also #10794.
Milestone 2.0 deleted