Opened 11 years ago

Closed 11 years ago

#6932 closed defect (fixed)

[patch] [cla] BorderContainer: splitter width/height not being computed

Reported by: guest Owned by: Adam Peller
Priority: high Milestone: 1.2
Component: Dijit Version: 1.1.1
Keywords: bordercontainer splitter Cc:
Blocked By: Blocking:

Description

Say I have a TabContainer? with a BorderContainer? in the 2nd tab. When the BorderContainer? does startup(), it computes the width/height of all splitters, but because it's in a tab that's not displayed, dojo.marginBox() returns zero.

This is easily fixed by just doing a sanity check on the splitter width/height when the BorderContainer? is asked to layout().

-Chris Barber

Attachments (3)

cb1-splitter-fix.patch (344 bytes) - added by guest 11 years ago.
cb1-splitter-fix-v2.patch (902 bytes) - added by guest 11 years ago.
cb1-splitter-fix-v2.1.patch (824 bytes) - added by guest 11 years ago.

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by guest

Attachment: cb1-splitter-fix.patch added

comment:1 Changed 11 years ago by Adam Peller

Owner: set to Adam Peller

hmm. perhaps we can optimize further by only doing this check when the initial result was zero? We shouldn't have to compute them on each layout.

comment:2 Changed 11 years ago by guest

Ok, I tried a different approach that works too. See v2 patch.

-Chris

Changed 11 years ago by guest

Attachment: cb1-splitter-fix-v2.patch added

comment:3 Changed 11 years ago by guest

Oops, I accidentally put spaces instead of tabs in the v2 patch. :)

Changed 11 years ago by guest

Attachment: cb1-splitter-fix-v2.1.patch added

comment:4 Changed 11 years ago by bill

Summary: [patch] [cla] BorderContainer splitter width/height not being computed[patch] [cla] BorderContainer: splitter width/height not being computed

Can you attach a test case? If BorderContainer initializes inside a hidden <div> there are more problems than just the splitter width. It won't be able to compute the size of any of the border panes. It sounds like this is a dup of #5672.

comment:5 Changed 11 years ago by guest

Here's the test case:

Bad http://www.cb1inc.com/files/BorderContainerBad.html

Fixed http://www.cb1inc.com/files/BorderContainerFixed.html

This just fixes the BorderContainer?'s splitter. I'm sure there are other widgets that are affected such as TabContainers? inside a BorderContainer? (afaik just the center region) don't resize when the browser is resized. But I'm sure that's probably another ticket...

comment:6 Changed 11 years ago by bill

OIC, then it's not a dup of #5672, since in this ticket BorderContainer is a direct child of TabContainer.

The first patch is probably OK... the second and third patch will work in the common case but will fail sometimes because they assume that the document has only one theme which is indicated on the <body> node. In other words, a splitter as a child of <body> may have a different width than the splitter as a child of a BorderContainer in some random place, because different CSS rules could be affecting it.

comment:7 Changed 11 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [14959]) Compute splitter thickness at layout time, if not already computed. Fixes #6932 !strict

Note: See TracTickets for help on using tickets.