Opened 12 years ago

Closed 11 years ago

#5731 closed enhancement (fixed)

TooltipDialog does not inherit class parameter

Reported by: guest Owned by: bill
Priority: high Milestone: 1.2
Component: Dijit Version: 1.0
Keywords: TooltipDialog class Cc:
Blocked By: Blocking:

Description (last modified by bill)

I'm creating a TooltipDialog? like so:

dlgRequest.widget = new dijit.TooltipDialog({"class":"drcdialog",style:"display:none"},dojo.byId("dlgRequest"));

The resulting DOM does not have this class:

<div id="drc-AddRequestLink25_dropdown" class="dijitPopup" style="z-index: 1000; visibility: visible; left: 49px; top: 158px;">
<div id="dlgRequest" class="dijitTooltipDialog dijitTooltipABLeft dijitTooltipAbove" style="" widgetid="dlgRequest" title="">
<div class="dijitTooltipContainer">
<div class="dijitTooltipContents dijitTooltipFocusNode" wairole="dialog" tabindex="0" dojoattachpoint="containerNode" role="wairole:dialog" title="">
<h1 id="dlgRequest-dialogTitle">Add Request</h1>
<form name="formRequest" method="post" action="tag.a5c62afd3abc241e.render.userLayoutRootNode.target.n159.uP#n159">
</form>
</div>
</div>
<span dojoattachevent="focus:_cycleFocus" tabindex="0" dojoattachpoint="tabEnd"/>
<div class="dijitTooltipConnector"/>
</div>
</div>

Change History (6)

comment:1 Changed 12 years ago by bill

Milestone: 1.0.31.2
Type: defectenhancement

Yes, that's correct, "class" is not a parameter to TooltipDialog?, or to most widgets. "baseClass" is a parameter to many form widgets but is not universal either.

In general the design is to wrap your class like

<div class="myClass">
    <div dojoType="dijit.foo">...</div>
</div>

and then write a custom rule like .myClass .dijitXXX { ... }. See tundra.css for examples.

However, that technique doesn't work for popup widgets so well, and is an open issue.

comment:2 Changed 12 years ago by Adam Peller

Owner: set to Adam Peller
Status: newassigned

comment:3 Changed 12 years ago by bill

Peller pointed out to me that there is a "class" attribute defined in _Widget, and the attributeMap code apparently does copy it to the domNode. Not sure why that isn't happening. In general for form widgets that's not a useful feature, since the class changes based on hover/focus state, but might be useful for something like TooltipDialog.

comment:4 Changed 11 years ago by guest

I have created a small demo page that shows this bug: http://queens.db.toronto.edu/~nilesh/misc/dojotooltipcustomization/

As result of this bug, currently there is no way of customizing the CSS of tooltipdialogs on a per-instance basis http://dojotoolkit.org/forum/dijit-dijit-0-9/dijit-support/bug-customizing-look-and-feel-tooltip-dialog

comment:5 Changed 11 years ago by bill

Description: modified (diff)
Owner: changed from Adam Peller to bill
Status: assignednew

comment:6 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

(In [14126]) Allow developer to specify custom class for TooltipDialog? widget. Fixes #5731. !strict

Note: See TracTickets for help on using tickets.