Created
March 13, 2016 08:12
-
-
Save oozzal/6ea286fa34ca1fc01432 to your computer and use it in GitHub Desktop.
Ember Simple Bootstrap Modal Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement: function() { | |
var self = this; | |
this.$('.modal') | |
.modal('show') | |
.on('hide.bs.modal', function() { | |
self.sendAction('onModalClose'); | |
}); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= bootstrap-modal onModalClose="closeModal" | |
.modal.fade role='dialog' | |
.modal-dialog | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model(params) { | |
return {}; | |
}, | |
actions: { | |
closeModal: function() { | |
this.transitionTo('application'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment