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

on-collapse-open event #14

Closed
eximius313 opened this issue Jun 20, 2015 · 6 comments
Closed

on-collapse-open event #14

eximius313 opened this issue Jun 20, 2015 · 6 comments

Comments

@eximius313
Copy link

Could you please restore on-collapse-open event from 0.5 version of this component?
Thank you in advance

@yesobo
Copy link

yesobo commented Jul 8, 2015

You could listen for the 'transitionend' event and check the 'opened' attribute to know if opened or closed

@notwaldorf
Copy link
Contributor

@eximius313 @yesobo opened is a notify property, so you can also listen to the opened-changed event as well. (and event.detail.value will be true or false accordingly). I think that's basically the same as on-collapse-open.

@eximius313
Copy link
Author

It is not the same thing.
opened-changed is fired immediately when the value has been changed even though iron-collapse has not fully opened.
on the contrary on-collapse-open serves exactly this purpose - is being fired only if core-collapse was fully opened.
Try to put google-map in iron collapse for example. If not on-collapse-open map will not work...

@morficus
Copy link

morficus commented Dec 4, 2015

@eximius313 not sure if you found a solution to your problem or not, but the comment from @yesobo works perfectly. The transitionend event doesn't get fired until AFTER the element is fully expanded or collapsed.

Here is some sample code.

this.listen(collapseEl, 'transitionend', 'adjustLayout');
function: adjustLayout(event) {
  if (event.target.opened) {
     // do some stuff
   } else {
     // do some other stuff
   }
}

Just for historical purposes: this was tried and worked in v1.0.4

@eximius313
Copy link
Author

@morficus - it worked as expected. Thank you

@morficus
Copy link

🎉

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

No branches or pull requests

4 participants