acoustep / ember-cli-foundation-6-sass

MIT License
64 stars 33 forks source link

sendAction for Events #72

Open jamiechong opened 7 years ago

jamiechong commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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.