mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
a4f8088697
closes #2417 - Adds Notification(s)Component - Render notifications in application.hbs - Adds handleError in application route
38 lines
No EOL
968 B
JavaScript
38 lines
No EOL
968 B
JavaScript
var Notifications = Ember.ArrayProxy.extend({
|
|
content: Ember.A(),
|
|
timeout: 3000,
|
|
pushObject: function (object) {
|
|
object.typeClass = 'notification-' + object.type;
|
|
// This should be somewhere else.
|
|
if (object.type === 'success') {
|
|
object.typeClass = object.typeClass + " notification-passive";
|
|
}
|
|
this._super(object);
|
|
},
|
|
showError: function (message) {
|
|
this.pushObject({
|
|
type: 'error',
|
|
message: message
|
|
});
|
|
},
|
|
showInfo: function (message) {
|
|
this.pushObject({
|
|
type: 'info',
|
|
message: message
|
|
});
|
|
},
|
|
showSuccess: function (message) {
|
|
this.pushObject({
|
|
type: 'success',
|
|
message: message
|
|
});
|
|
},
|
|
showWarn: function (message) {
|
|
this.pushObject({
|
|
type: 'warn',
|
|
message: message
|
|
});
|
|
}
|
|
});
|
|
|
|
export default Notifications; |