mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
Fix alerts not dismissing
This commit is contained in:
@@ -31,7 +31,7 @@ export default JsonApiAdapter.extend({
|
|||||||
} else {
|
} else {
|
||||||
message = errors.message;
|
message = errors.message;
|
||||||
}
|
}
|
||||||
var alert = AlertMessage.create({
|
var alert = AlertMessage.extend({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
message: message
|
message: message
|
||||||
});
|
});
|
||||||
|
@@ -8,7 +8,7 @@ export default Ember.Controller.extend({
|
|||||||
this.get('alerts').pushObject(message);
|
this.get('alerts').pushObject(message);
|
||||||
},
|
},
|
||||||
dismissAlert: function(message) {
|
dismissAlert: function(message) {
|
||||||
this.get('alerts').removeObject(message);
|
this.get('alerts').removeObject(message.constructor);
|
||||||
},
|
},
|
||||||
clearAlerts: function() {
|
clearAlerts: function() {
|
||||||
this.get('alerts').clear();
|
this.get('alerts').clear();
|
||||||
|
@@ -6,7 +6,7 @@ import AlertMessage from 'flarum/components/ui/alert-message';
|
|||||||
export default Ember.Route.extend(ApplicationRouteMixin, {
|
export default Ember.Route.extend(ApplicationRouteMixin, {
|
||||||
activate: function() {
|
activate: function() {
|
||||||
if (!Ember.isEmpty(FLARUM_ALERT)) {
|
if (!Ember.isEmpty(FLARUM_ALERT)) {
|
||||||
this.controllerFor('alerts').send('alert', AlertMessage.create(FLARUM_ALERT));
|
this.controllerFor('alerts').send('alert', AlertMessage.extend(FLARUM_ALERT));
|
||||||
FLARUM_ALERT = null;
|
FLARUM_ALERT = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user