1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 00:47:00 +02:00

Move alerts to their own controller

This commit is contained in:
Toby Zerner
2015-02-08 15:51:40 +10:30
parent 28d213d868
commit 2d181933ea
8 changed files with 47 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ import ComposerDiscussion from '../components/discussions/composer-discussion';
import AlertMessage from '../components/alert-message';
export default Ember.Controller.extend(Ember.Evented, PaneableMixin, {
needs: ['application', 'composer', 'index/index', 'discussion'],
needs: ['application', 'composer', 'alerts', 'index/index', 'discussion'],
index: Ember.computed.alias('controllers.index/index'),
@@ -19,7 +19,7 @@ export default Ember.Controller.extend(Ember.Evented, PaneableMixin, {
var stream = this.get('stream');
composer.set('content.loading', true);
controller.get('controllers.application').send('clearAlerts');
controller.get('controllers.alerts').send('clearAlerts');
var discussion = this.store.createRecord('discussion', {
title: data.title,
@@ -38,7 +38,7 @@ export default Ember.Controller.extend(Ember.Evented, PaneableMixin, {
type: 'warning',
message: reason.errors[i]
});
controller.get('controllers.application').send('alert', message);
controller.get('controllers.alerts').send('alert', message);
}
})
.finally(function() {