Opened 13 years ago
Closed 12 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)
Change History (10)
Changed 13 years ago by
Attachment: | cb1-splitter-fix.patch added |
---|
comment:1 Changed 13 years ago by
Owner: | set to Adam Peller |
---|
comment:2 Changed 13 years ago by
Ok, I tried a different approach that works too. See v2 patch.
-Chris
Changed 13 years ago by
Attachment: | cb1-splitter-fix-v2.patch added |
---|
comment:3 Changed 13 years ago by
Oops, I accidentally put spaces instead of tabs in the v2 patch. :)
Changed 13 years ago by
Attachment: | cb1-splitter-fix-v2.1.patch added |
---|
comment:4 Changed 13 years ago by
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 13 years ago by
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 13 years ago by
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 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.