Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

sendAction for Events #72

Open
jamiechong opened this issue May 26, 2017 · 2 comments
Open

sendAction for Events #72

jamiechong opened this issue May 26, 2017 · 2 comments

Comments

@jamiechong
Copy link

I'm looking for a way to trigger an action in my controller when the Reveal widget is closed. Foundation has these events: http://foundation.zurb.com/sites/docs/reveal.html#js-events

It would be great if I could setup my component like this:
{{#zf-reveal onClose=(action 'modalClosed')}}

@jamiechong
Copy link
Author

jamiechong commented May 27, 2017

Note that I was able to achieve this by modifying zf-reveal.js.

  handleInsert() {
    this.$().css("outline", "none");

    this.$().on("closed.zf.reveal", () => {
      this.sendAction('onClosed');
    });
  }

It might be worth doing this for all Foundation actions to make the addon more complete.

@GCheung55
Copy link
Collaborator

@jamiechong I agree with you. It would be helpful to have a map of all the events for each Foundation component so that action closures could be passed in.

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

No branches or pull requests

2 participants