framework/ember/app/routes/application.js

41 lines
895 B
JavaScript
Raw Normal View History

2014-12-20 14:26:46 +08:00
import Ember from 'ember';
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';
export default Ember.Route.extend(ApplicationRouteMixin, {
actions: {
login: function() {
this.controllerFor('login').set('error', null);
2015-02-08 13:29:39 +08:00
this.send('showModal', 'login');
},
signup: function() {
this.controllerFor('signup').set('error', null);
this.send('showModal', 'signup');
},
showModal: function(name) {
this.render(name, {
into: 'application',
outlet: 'modal'
});
2015-02-08 13:29:39 +08:00
this.controllerFor('application').set('modalController', this.controllerFor(name));
},
closeModal: function() {
2015-02-08 13:29:39 +08:00
this.controllerFor('application').set('modalController', null);
},
destroyModal: function() {
this.disconnectOutlet({
outlet: 'modal',
parentView: 'application'
});
},
2015-02-08 13:29:39 +08:00
sessionChanged: function() {
this.refresh();
2015-02-08 13:29:39 +08:00
}
}
2015-02-08 13:29:39 +08:00
});