Skip to content

Instantly share code, notes, and snippets.

@lessless
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lessless/c8ab7927e6708341c48f to your computer and use it in GitHub Desktop.
Save lessless/c8ab7927e6708341c48f to your computer and use it in GitHub Desktop.
zurb reveal
<div id="{{modalId}}" class="reveal-modal small" data-reveal aria-hidden="true" role="dialog">
{{yield}}
</div>
import Ember from 'ember';
export default Ember.Component.extend({
toggleDialog: function() {
if (this.get('display') === true) {
this.send('showModal');
}
else {
this.send('closeModal');
}
}.observes('display'),
modalId: function() {
return Ember.guidFor(this + 'modal');
}.property(),
actions: {
showModal: function() {
let modalId = '#' + this.get('modalId');
this.$(modalId).foundation('reveal', 'open');
},
closeModal: function() {
let modalId = '#' + this.get('modalId');
Ember.$(modalId).foundation('reveal', 'close');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment