mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
156260343b
closes #5903, refs #5409 - switch alert/notification component tests from unit to integration where appropriate - rename `notifications.closeAll` to `notifications.clearAll` to better represent it's behaviour - add concept of a "key" to alerts/notifications and ability to close only specified keys through notifications service - close duplicate alerts/notifications before showing a new one - specify a key for all existing alerts - close failure alerts on successful retries - clear all currently displayed alerts on successful sign-in
23 lines
569 B
JavaScript
23 lines
569 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Controller.extend({
|
|
notifications: Ember.inject.service(),
|
|
|
|
acceptEncoding: 'image/*',
|
|
|
|
actions: {
|
|
confirmAccept: function () {
|
|
var notifications = this.get('notifications');
|
|
|
|
this.get('model').save().then(function (model) {
|
|
return model;
|
|
}).catch(function (err) {
|
|
notifications.showAPIError(err, {key: 'image.upload'});
|
|
});
|
|
},
|
|
|
|
confirmReject: function () {
|
|
return false;
|
|
}
|
|
}
|
|
});
|