Uh oh!
There was an error while loading. Please reload this page.
feat: Programmatically toggle containers - #154
Conversation
Enables: - programmatically un/collapse containers using collapsed attribute - collapsing containers on app start (see comment in directive uiLayoutLoaded) - introduces concept of "central" container - add animation for collapsing - fixesangular-ui#129, angular-ui#100 - few formatting changes
j--w
commented
Nov 4, 2015
@petrsimon created a plunker to demonstrate these fixes here: http://plnkr.co/edit/u8hJG42cMQDg9KiG86as Unfortunately a couple of tests are failing, @petrsimon have you had a chance to look at the failing tests? |
petrsimon
commented
Nov 4, 2015
Weird. On my system, I see 61 test running, all passing. Can you tell me which ones? |
j--w
commented
Nov 4, 2015
It looks like it's the splitMove tests have a look at the log here for more detail: https://travis-ci.org/angular-ui/ui-layout/builds/88887198 |
petrsimon
commented
Nov 4, 2015
Ah, thanks. I've missed that. I thought it's just the jshint, since it's all passing on my computer. |
petrsimon
commented
Nov 4, 2015
I see, it's failing on Firefox 31, I've got it passing on 41. Are we supposed to support browser that old? |
j--w
commented
Nov 4, 2015
I'll defer to @SomeKittens for that question but I would assume so as all the other angular-ui stuff on travis seems to be running tests in that version. |
petrsimon
commented
Nov 4, 2015
Right. That naturally makes sense. Just not sure how to go about fixing this... |
petrsimon
commented
Nov 4, 2015
Just ran the test with FF31. |
j--w
commented
Nov 4, 2015
I just pulled down your branch to my local and the same tests fail for me in chrome 46 and firefox 41 but pass in phantomjs. Any ideas? I may be able to do a bit of digging tomorrow. |
petrsimon
commented
Nov 4, 2015
OK, I can reproduce it now, only on Chrome, though... (on OSX) (confession: actually I didn't have stable chrome installed and I forgot to turn Canary on, that's why I missed it). Thanks a lot and also for the eagerness to dig! It bugged me, so I had to take a quick look. It's caused by rounding down. To recap what is going on in the test:
The test is working outside this branch, because originally How about if in case of odd numbers, we add the remainder to the last 'auto' sized container and adjust the tests. |
SomeKittens
commented
Nov 4, 2015
Opened #156 to cover browser testing. And yeah, rounding is fun! I'm fine with adjusting the tests to cover reasonable off-by-one cases due to rounding. |
petrsimon
commented
Nov 4, 2015
Thanks @SomeKittens! The current tests are simply testing a bug, which is caused by rounding in the code (not default sub-pixel value rounding in the browsers). Hackish way to fix the test would be to resize the viewport in But I guess the best way to do it is to add the dangling pixel to the last auto sized element. |
j--w
commented
Nov 6, 2015
I think adding the dangling pixel to the last auto sized element makes sense. |
BobbieBarker
commented
Nov 7, 2015
I'm also fine with adjusting the tests to deal with the scenario. I just did an initial review I found a few style issues. I'm going to try and review it again to dig into more of what you're doing etc before I sign off, but initial review looks good. Should be able to get it merged in pretty quickly after the tests are fixed. |
petrsimon
commented
Nov 7, 2015
I didn't want to mess with the style too much, since I've got more ideas in that area and thought I'll do another PR for that, but those few small changes you've mentioned, I'll change right away. I've got the dangling pixel basically taken care of, just have to fix the test and see that it doesn't brake anything else. |
SomeKittens
commented
Nov 7, 2015
Yeah, there's a few lingering style issues I'd like to fix but haven't yet. Thanks for following what you saw. Good news about the pixel! Looking forward to it. |
petrsimon
commented
Nov 7, 2015
Will do my best! :) |
Remainder from rounding down of autoSize value is added to the last container of a layout. - Tests adjusted to account for the new container sizing - Few style fixes as suggested during PR review
petrsimon
commented
Nov 8, 2015
Please have a look. |
SomeKittens
commented
Nov 10, 2015
Latest commit LGTM |
petrsimon
commented
Nov 10, 2015
My pleasure! Let's see if others find anything fishy... |
BobbieBarker
commented
Nov 15, 2015
LGTM as well, it looks like jshint failed on your build though. Fix and we'll accept. Also, thank you for putting up with all the back and forth, your contribution is definitely welcome! |
This is temporary formatting change, which should later be revised.
petrsimon
commented
Nov 16, 2015
No worries, happy to contribute. |
feat: Programmatically toggle containers
BobbieBarker
commented
Nov 16, 2015
PR accepted, this project needs a lot of TLC if you'd like to submit additional pull requests to deal with short comings etc you're more than welcome to. |
petrsimon
commented
Nov 16, 2015
Wonderful! Thank you. I'll have couple of other ideas, so I'm planning to make issues or PRs soon. |
Enables: