1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/components/gh-alerts.js

18 lines
493 B
JavaScript
Raw Normal View History

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