mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
Move alerts to their own controller
This commit is contained in:
17
ember/app/controllers/alerts.js
Normal file
17
ember/app/controllers/alerts.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
alerts: [],
|
||||
|
||||
actions: {
|
||||
alert: function(message) {
|
||||
this.get('alerts').pushObject(message);
|
||||
},
|
||||
dismissAlert: function(message) {
|
||||
this.get('alerts').removeObject(message);
|
||||
},
|
||||
clearAlerts: function() {
|
||||
this.get('alerts').clear();
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user