Ghost/ghost/admin/app/components/gh-alerts.js

18 lines
483 B
JavaScript
Raw Normal View History

import Component from 'ember-component';
import {alias} from 'ember-computed';
import injectService from 'ember-service/inject';
import observer from 'ember-metal/observer';
export default Component.extend({
2015-05-21 20:03:24 +03:00
tagName: 'aside',
classNames: 'gh-alerts',
notifications: injectService(),
2015-05-21 20:03:24 +03:00
messages: alias('notifications.alerts'),
2015-05-21 20:03:24 +03:00
messageCountObserver: observer('messages.[]', function () {
2015-05-21 20:03:24 +03:00
this.sendAction('notify', this.get('messages').length);
})
});