Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11591 closed defect (wontfix)

wrong presentation of custom elements in TitlePane.titleBarNode since Dojo v1.5

Reported by: Chris2 Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.5
Keywords: TitlePane, Focus, titleBarNode Cc:
Blocked By: Blocking:

Description (last modified by bill)

currently i am using v1.4 and trying to switch to v1.5.

I define some custom TitlePane-mixins to show additional information inside the TitleBar. For example:

dojo.declare("DateTitlePane", [dijit.TitlePane], {
	postCreate:function() {
		dojo.create("div", {
			style: "float:right; margin: 0px; padding: 0px;",
			innerHTML: dojo.date.locale.format(this.date) },
		this.titleBarNode);

		this.inherited("postCreate", arguments);
	}
});

(fyi: In an another mixin i'm adding an progressBar and a button to it) But now with v1.5 the added elements appear (visually) below the titleBarNode instead of inside it. I guess this behavior has something to do with [21642]

Change History (4)

comment:1 Changed 9 years ago by Chris2

sorry, i meant changeset instead of ticket: http://bugs.dojotoolkit.org/changeset/21642

comment:2 Changed 9 years ago by bill

Description: modified (diff)
Resolution: wontfix
Status: newclosed

No problem.

I can reproduce your issue by loading test_TitlePane.html and in firebug console doing:

dojo.create("div", {
	style: "float:right; margin: 0px; padding: 0px;",
	innerHTML:"hello world" },
dijit.byId("testPane1").titleBarNode);

It's "fallout" from the claro redesign work, and adding a focusNode for the dotted focus border.

Anyway, what you need to do is simply to use focusNode instead of titleBarNode, like this:

dojo.declare("DateTitlePane", [dijit.TitlePane], {
	postCreate:function() {
		dojo.create("div", {
			style: "float:right; margin: 0px; padding: 0px;",
			innerHTML: dojo.date.locale.format(this.date) },
		this.focusNode);

		this.inherited(arguments);
	}
});

(Also note that your first argument to this.inherited() was unneeded.)

comment:3 Changed 9 years ago by Chris2

Thanks for that quick answer. This fixes my issues but i feel a little bit strange about adding elements to a node which is called "focusNode" since i just want to add something to the title-bar.

And thanks for the additional information about "inherited".

comment:4 Changed 9 years ago by bill

Yah, it sounds strange, but remember that the title bar gets focus, so that keyboard only users have a way to open close the TitlePane.

Note: See TracTickets for help on using tickets.