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

Visible property for toggle split area on and off, which changing structure of the view #8

Closed
wants to merge 5 commits into from

Conversation

jitsmaster
Copy link
Contributor

The need arises due to the need of place router outlets inside split areas that need to be toggled on/off.

Since Router v3, router outlet inside a conditional area will not persist. This make routing on that outlet generating errors.

The purpose of this change is to simply hide the split area, not removing it, this way the router outlet will always be a there, and any other view children that need to persist will be always there too.

bertrandg and others added 3 commits January 19, 2017 10:27
The purpose of visibility for split areas if to establish persiting router
outlets within each split area.

Since new router v3. Router outlet within conditional split areas can't be
consistently relied on.

Extensive testing were done, to make sure this change doesn't impact how the
split areas' conditional rendering, just add ability to toggle areas
on/off visually.
@bertrandg
Copy link
Contributor

Nice,
Yes I understand the need, I will take time to test it and then, if everything's fine, merge it and add an example into website.

Do you try to mix 'conditionnal areas' and 'visibibity areas' and toggling them?

@jitsmaster
Copy link
Contributor Author

jitsmaster commented Jan 20, 2017 via email

of area, instead of conditional create the area.

Also, extracted some hard-coded styles into css classes, that will be
contained within the component.
@bertrandg
Copy link
Contributor

hi @jitsmaster
I've just played with your [visible] feature and it seems to works fine mixed with *ngIf:
https://plnkr.co/edit/GyQnxE?p=preview

What did you mean by: "I didn't want take conditional areas out, fear that will break existing implementations." ?

I've seen you add an other feature about animation and changed styles, can you keep it for an other pull request please.

@jitsmaster
Copy link
Contributor Author

jitsmaster commented Jan 27, 2017 via email

transitionend events of the split areas, after show/hide animations
finishes.

Also, upgrade Angular 2 to 2.4.3.
@jitsmaster
Copy link
Contributor Author

Checking on how soon you can merge in my pull request. My app is getting pretty close to production state. Would really get the NPM package to be updated.

Also, I have created a new 'layoutEnd' event for split component. It is trigger after the animation ended for split area show/hide. Would love to pull this one into master too.

@bertrandg
Copy link
Contributor

Yes I understand, I do that before the end of the week! :)

@bertrandg
Copy link
Contributor

hi @jitsmaster
I'm finally on it! 😳

I would like to first merge your 3 commits from 19 January (only about toggling visibility) but there are 2 more about animation/layoutEnd in the pull request..
https://github.com/bertrandg/angular-split/pull/8/commits

Is it possible to lock your pull request to specific commit (e539e79) ?

About animation/layoutEnd, I haven't test it already but it seems to change a lot of things I need to test because I use it too on a prod app at work. (multi browser animation / multiple "soft removed" at same time)
And is there a specific reason to update dependencies to 2.4.3?

@jitsmaster
Copy link
Contributor Author

jitsmaster commented Feb 3, 2017 via email

@jitsmaster
Copy link
Contributor Author

Done. A new pull request is created, that includes only the visibility feature. Let me know if you want to reject this pull request and let me create another one after visiblity feature is merged.

@bertrandg
Copy link
Contributor

simple visibility toggle feature (c7c92b9 + e539e79)

I tested it more today and found a bug, check this plunker:
https://plnkr.co/edit/GyQnxE?p=preview

Click button "toggle visible C", areaC disapears but there's still a gutter on the right that shouldn't be there:
bug_visibility_toggling

Should be solvable with this but need to be tested:
bug_fix

animation/layoutEnd feature (ee14002 + cee8d50)

  • Inside split.component.ts, I hade to import these 3 rxjs operator to make it works:
    missing_rx_imports

  • I found the way you emit your layoutEnd inside split.component.tsusing merge/debounceTime/... a bit "overengineered". I'm sure we can do it easily without subscribing an observable with many operators.
    Why not inside splitArea.component.ts > function onSizingTransitionEnd() directly call this.split.notify('sizingEnd') only from areas you know visibility boolean just changed?

  • You used several times /deep/ inside styles, not sure if that's "future proof"..
    It only works with ViewEncapsulation.Emulated:
    https://angular.io/docs/ts/latest/guide/component-styles.html#!#special-selectors


I think the best way to merge it quickly is to first make a new pull-request with c7c92b9 + e539e79 + bug fix.
And then an other.

And sorry for the time it took me to answer you with details.

@jitsmaster
Copy link
Contributor Author

Thank you for finding that bug. I will put in the fix in the other pull request.

Regarding the layoutEnd event firing, it was caused by transitionend event somehow fired multiple time on both chrome and firefox, so I had to debounceTime on it.

Also I had to merge all events together in case 2 or more areas are toggled in the same time, and their transitionend firing will not be in the same time.

I will test the css changes in shadow dom scenario

@bertrandg
Copy link
Contributor

Cool, I wait for your commit on the other PR and will merge it quickly.
I will close this one.

@bertrandg bertrandg closed this Feb 3, 2017
@jitsmaster
Copy link
Contributor Author

That is weird you still have to import the specific operators. I haven't needing to do it for quite a while.

Angular 2.4.1 had a very strange bug of sometimes AOT build put ngfactory files in the source folder.

2.4.3 seems to fix the issue.

@jitsmaster
Copy link
Contributor Author

You are right that /deep/ indeed doesn't work on native view encapsulation. What is even worse if the flex direction will not be set with class.

I see you are directly setting the style of flex direction on hostbinding. Is it your recommended approach?

@jitsmaster
Copy link
Contributor Author

Actually, take that back. The only thing that wasn't working was the vertical direction. As soon as I use the same way of hostbinding seting flex direction. Everything works, including animation, in native mode.

I am creating a pull request now

@bertrandg
Copy link
Contributor

Ok, yes Hostbinding() is a good way to achieve it.

@angular-split angular-split locked and limited conversation to collaborators Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants