-
Notifications
You must be signed in to change notification settings - Fork 212
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
Toggle animation and layoutEnd event #11
Conversation
of area, instead of conditional create the area. Also, extracted some hard-coded styles into css classes, that will be contained within the component.
transitionend events of the split areas, after show/hide animations finishes. Also, upgrade Angular 2 to 2.4.3.
are supported in native view encapsulation
src/split.component.ts
Outdated
@@ -201,6 +207,21 @@ export class SplitComponent implements OnChanges, OnDestroy { | |||
this.areas.sort((a, b) => +a.orderUser - +b.orderUser); | |||
} | |||
|
|||
if (this.areas.length > 1) { | |||
var l = this.areas.length; |
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.
Unused var..
src/split.component.ts
Outdated
@@ -201,6 +207,21 @@ export class SplitComponent implements OnChanges, OnDestroy { | |||
this.areas.sort((a, b) => +a.orderUser - +b.orderUser); | |||
} | |||
|
|||
if (this.areas.length > 1) { | |||
var l = this.areas.length; | |||
var c = 0; |
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.
Unused var..
src/split.component.ts
Outdated
if (this.areas.length > 1) { | ||
var l = this.areas.length; | ||
var c = 0; | ||
var sub = this.areas[0].component.sizingEnd |
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.
Weird stuff that could lead to increasing number of subscriptions (refresh is called a lot of times).
'debounceTime' of 500ms make the EventEmitter emits at wrong times I imagine?
I will try to find a way to avoid a subscribtion to child eventEmitters... For me, splitArea components should notify split component directly calling a function on it because they already have it injected.
I didn't play with it already but I've seen several things to change before merging it. |
I'm afraid And I will make a warning about using |
Thank you very much for looking into it. Unfortunately I can't do anything yet. Snow storm hit Seattle area. My house is out of power. Estimated to be fixed by tomorrow. Then I can get back on it. You did some great refactors to my last pull request. Appreciate it. |
No problem! :) |
Finally have time to get back on it. "visibleTransitionEnd" is a better name. I am thinking about the possibility of having layoutEnd to include ngIf scenarios too. But that is a much bigger refactor, means to hook up observables in tabs toggling, so the ngIf can use async pipes, and split component and capture those events and use layoutEnd. We will just call the event visibleTransitionEnd for now. I will put it the simple fixes and look into simple area event for visibility toggle |
Cool, take a look at this plunker, I found a way to avoid any subscription in Yes having transition for |
Are you talking about using Subject and asObservable? The subject still needs to be triggered somehow. I am putting together the changes now that will reduce the amount of subscriptions, and clean them up up front. |
I normally use BehaviorSubject, because it can be triggered repeatedly. Subject is normally for fire and forget |
Ditched the centralized merged subscriptions and hooked up to invididual area sizingEnd event. Prevent multiple firing of sizingEnd event from split areas, by limiting to flex-basis only on the event property. Update comments on visibleTransitionEnd to better describing how to subscribe to it. Use BehaviorSubject instead of eventemitter to prevent outside party triggering this event.
Done. I kept the structure of subject.asObservable. It is not very necessary, just prevent outside party from triggering the event. You can change it back to EventEmitter if you feel like it. |
My plunker was about the fact I avoided any subscription inside I used I will try to merge it next weekend. |
Thank you |
I see what you mean. I will make that change. |
remove the sizingEnd event from areas, and have them directly invoke notify function on split component. Area was already tightly coupled with split component, so this is a better way to make thing happen.
The last changed removed the event driven system altogether for for visibleTransitionEnd event gets triggered. |
Yes you got it, Now, if there isn't need for I was asking myself, just by curiosity, what is your use case which need thanks ;) |
The use case is same as dragEnd. I am doing some crazy Angular 2 implementation by use angular component as shell to wrap up dojo widgets. Those dojo widgets are manually layed out and depending on the event to resize itself. I have left panel in the split container that toggle on/off all the time, and right side content widgets need to listen to the toggle event and resize itself. |
Have you had he chance to merge it in last weekend? Sorry for bug you, but AOT compiler doesn't like npm links |
Actually, no worry. I figured out how to to npm install directly from github repo. Just some minor twick on .gitignore to make things work. Glad you are including everything in dist folder. All I have to do is removing the src in dist folder to fix AOT compiler issue. I am good for now. |
I'm on it, I merged it and pushed it in 'test-pr' branch: But when testing, I've seen that |
That was the reason I went with the more complex approach to debounce the event and make it only fire once. It is indeed what I see. Do you want me to revert it back to the old way? |
Ok, no thanks I will add it. |
Merged and published 0.1.20 :) |
You da man. Thank you very much. Pleasure working with you.
…On Sat, Mar 11, 2017, 1:59 PM bertrandg ***@***.***> wrote:
Closed #11 <#11>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/APGpof99s1_XSTNOtb4SaZUdqWJHrwx-ks5rkxlBgaJpZM4L3T3b>
.
|
Thanks to participate there. |
Added css based animation when split area toggle visibility. The animation is off by default
add layoutEnd event on transitionend during split area visibility toggle.