Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#famousIf broken ?! #179

Closed
mcbain opened this issue Dec 4, 2014 · 3 comments
Closed

#famousIf broken ?! #179

mcbain opened this issue Dec 4, 2014 · 3 comments

Comments

@mcbain
Copy link
Collaborator

mcbain commented Dec 4, 2014

Using a #famousIf with HeaderFooterLayout to show/hide e.g. the header on some condition throws an error. Using other layouts the same e.g. BoxLayout.

http://meteorpad.com/pad/ZFfbdPaPh6N2YvWSx/#famousIf broken

In the examle the #famousIf is commented out

@gadicc
Copy link
Owner

gadicc commented Dec 4, 2014

Weird, I was actually just thinking about this yesterday.

#famousIf was designed to be used inside a sequenceable view (i.e. any view with a .sequenceFrom() method). It's purpose was to make sure that if the condition changed, it's contents would be inserted into the right place.

But I was thinking just yesterday (actually after looking at the useraccounts code) that it should also work for a node that just has an add() method, to show/hide a single child. It's actually on my TODO list. So yeah, situations like this will be working soon... for now you can use a regular if as long as once something is added, it never needs to be removed, and there's no else, or it never changes. Yeah, some fun conditions, and amazingly, it's never come up before :)

@gadicc gadicc closed this as completed in 620d5a7 Dec 5, 2014
gadicc added a commit that referenced this issue Dec 5, 2014
@gadicc
Copy link
Owner

gadicc commented Dec 5, 2014

in master, will be in next release. not 100% sure when that will be, there have been a few changes which I want to make sure don't break anything before next release (like the nextTick stuff).

@mcbain
Copy link
Collaborator Author

mcbain commented Dec 5, 2014

cool thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants