-
-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for more than two elements - fixes #1
- Loading branch information
1 parent
d55f020
commit b36b5b1
Showing
1 changed file
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b36b5b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 138: Should isFirst be (i==0) rather than (i==1)?
b36b5b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried several cycles of dragging both gutters in the three-pane example left and right?
When I do that, the right edge of the right pane creeps gradually to the left.
Don't know whether this is due to the isFirst i==0 vs i==1 issue or something else.
b36b5b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More specifically, in the three-pane example:
Call the two gutters GL and GR, for left and right.
From initial position, drag GR to the left. The right edge of the right pane move left. Holding the mouse button down, moving the mouse back and forth, the right edge does not move more, but releasing the mouse button, re-grabbing and dragging left again makes the right edge move left again.
b36b5b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i == 1
is because the pairs are only created oncei > 0
. Will look into the moving problem. My guess is thatclientWidth
returns whole integers, which we then use to generate float percentages, so over time things will wobble.Parsing the CSS calc() like you were doing might be better.
b36b5b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The right edge of the right pane migrates left in the two-pane example, too.
b36b5b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a new issue for this here: #3