1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 23:44:27 +02:00

Signup + modal refactoring

This commit is contained in:
Toby Zerner
2015-02-08 15:59:39 +10:30
parent 6c3debc79b
commit d45f2fd1ac
14 changed files with 193 additions and 69 deletions

View File

@@ -6,22 +6,35 @@ export default Ember.Route.extend(ApplicationRouteMixin, {
actions: {
login: function() {
this.controllerFor('login').set('error', null);
this.render('login', {
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'
});
this.controllerFor('application').set('modalController', this.controllerFor(name));
},
closeModal: function() {
this.controllerFor('application').set('modalController', null);
},
destroyModal: function() {
this.disconnectOutlet({
outlet: 'modal',
parentView: 'application'
});
},
sessionChanged: function() {
sessionChanged: function() {
this.refresh();
}
}
}
});
});