Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1211 closed defect (fixed)

Dynamically-created Tooltips have no content.

Reported by: terry.field@… Owned by: liucougar
Priority: high Milestone:
Component: Widgets Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

Somewhere over the last month or so, dynamic creation of tool tips got broken. You just get a tiny tell-tale without any content. Here's a test case:

<html> <head>

<title>Dojo Dynamic Tooltip Test</title>

<script type="text/javascript">

var djConfig = {isDebug: true, debugAtAllCosts: false };

</script>

<script type="text/javascript" src="../../dojo.js"></script> <script type="text/javascript">

dojo.require("dojo.widget.Tooltip");

</script>

<script type="text/javascript">

var tt = null; dojo.addOnLoad(function() {

tt = dojo.widget.createWidget("Tooltip", {

connectId: "one", caption: "dynamic", toggle: "fade", hideDelay: 0

});

});

</script>

</head>

<body>

<h1>Tooltip test</h1> <p>Mouse-over the item below to test dynamic tooltip:</p> <p>

<span id="one" class="tt">text</span>

</p>

</body> </html>

I've debugged it as far as createWidget() in Parse.js. At the end of that method, it clobbers the content:

if (notRef) {

if (widgetArray[0].domNode.parentNode) {

widgetArray[0].domNode.parentNode.removeChild(widgetArray[0].domNode);

}

}

Attachments (1)

1211.patch (5.1 KB) - added by liucougar 13 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 13 years ago by bill

Milestone: 0.4

I talked to Cougar about this today. Basically, Tooltip needs to be modified to extend PopupContainer?, and then to do a createWidget("ContentPane?"), rather than vice-versa like it is now.

Or perhaps the template for Tooltip could be something like

<div dojoType="ContentPane">${this.caption}</div>

and then inside postCreate() you could call

dojo.widget.createWidget(this.domNode);

(except the above call somehow has to set "this" as the Content Pane's parent widget.)

Changed 13 years ago by liucougar

Attachment: 1211.patch added

comment:2 Changed 13 years ago by liucougar

Resolution: fixed
Status: newclosed

fixed in r5125

comment:3 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.