Opened 12 years ago
Closed 12 years ago
#9330 closed defect (fixed)
dijit tooltip.js open function references nonexistant _connectNodes
Reported by: | darekana | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.3.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dijit/Tooltip.js open function references nonexistant _connectNodes: line 327 in http://svn.dojotoolkit.org/src/dijit/trunk/Tooltip.js
this._connectNode"? |
Change History (5)
comment:1 Changed 12 years ago by
Component: | General → Dijit |
---|---|
Milestone: | tbd → 1.4 |
Owner: | changed from anonymous to bill |
Status: | new → assigned |
comment:2 follow-up: 3 Changed 12 years ago by
Hmm, the only time this is an issue is when/if open() is called without an argument. Is that what you are doing?
Open() is commented as private (although forgot to use an underscore in the name), and also the target parameter is *not* marked optional, so I'm tempted to just remove this code for finding a default value.
comment:3 Changed 12 years ago by
I wanted to wire and create Tooltips on first mouseenter in which case some sort of way to trigger display (either open(target) or _onHover(event)) would be nice.
Probably what I really want is a public onHover(target)... so the delay and stuff works as if it was mouseover a regular tooltip target and the event doesn't have to be there.
createTooltip: function(target, evt, key) { if (typeof key == "undefined") { // try to get from target.id var idParts = target.id.split("_"); key = idParts[idParts.length - 1]; } var wId = "tt_" + key; var tip = dijit.byId(wId); if (!tip) tip = new ch.Tooltip({ label: chGlobal.getTooltipLabel(key), id: wId }); if (!tip.hasTarget(target)) { tip.addTarget(target); tip.open(target); } },
then in onload connect
dojo.query(".tooltipEnabled") .connect("onmouseenter", function(e) { createTooltip(e.target); })
or html
<a href="#" onmouseover="createTooltip(this)">...
Maybe there is a better way to handle tons of tooltips?
Thanks for the fast response!
Replying to bill:
Hmm, the only time this is an issue is when/if open() is called without an argument. Is that what you are doing?
Open() is commented as private (although forgot to use an underscore in the name), and also the target parameter is *not* marked optional, so I'm tempted to just remove this code for finding a default value.
comment:4 Changed 12 years ago by
I see... although that doesn't explain how you came across this defect, since the problem is only when you *don't* pass an argument to open(), isn't it?
Anyway, I see what you are saying about deferring tooltip creation to speed up page load, although it seems like maybe you would be better off creating a single Tooltip object, connected to all the relevant nodes, and then in the onShow() handler deal w/customizing the tooltip text? That would eliminate the initial cost of creating a bunch of Tooltip objects, although it will take some time to create all the onmouseenter/onmouseleave handlers (but you need those anyway, right?).
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Oh sorry, my fault from [17437].
I removed that attribute but forgot about that reference.