Skip to content

Instantly share code, notes, and snippets.

@wecc
Created April 30, 2014 21:02
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 wecc/997a81fa68ded7491c14 to your computer and use it in GitHub Desktop.
Save wecc/997a81fa68ded7491c14 to your computer and use it in GitHub Desktop.
App.MyModalComponent
App.MyModalComponent = Ember.Component.extend({
actions: {
ok: function() {
this.$('.modal').modal('hide');
this.sendAction('ok');
}
},
show: function() {
this.$('.modal').modal()
.on('shown.bs.modal', function() {
this.$('[autofocus]').focus();
}.bind(this))
.on('hidden.bs.modal', function() {
this.sendAction('close');
}.bind(this));
}.on('didInsertElement')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment