0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/client/app/components/gh-alerts.js
2015-05-22 19:05:17 +01:00

18 lines
576 B
JavaScript

import Ember from 'ember';
var AlertsComponent = Ember.Component.extend({
tagName: 'aside',
classNames: 'gh-alerts',
messages: Ember.computed.filter('notifications', function (notification) {
var displayStatus = (typeof notification.toJSON === 'function') ?
notification.get('status') : notification.status;
return displayStatus === 'persistent';
}),
messageCountObserver: Ember.observer('messages.[]', function () {
this.sendAction('notify', this.get('messages').length);
})
});
export default AlertsComponent;