2015-05-21 11:03:24 -06:00
|
|
|
import Ember from 'ember';
|
2015-06-18 22:56:18 +01:00
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
const {Component, computed, inject, observer} = Ember;
|
|
|
|
const {alias} = computed;
|
|
|
|
|
|
|
|
export default Component.extend({
|
2015-05-21 11:03:24 -06:00
|
|
|
tagName: 'aside',
|
|
|
|
classNames: 'gh-alerts',
|
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
notifications: inject.service(),
|
2015-05-21 11:03:24 -06:00
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
messages: alias('notifications.alerts'),
|
2015-05-21 11:03:24 -06:00
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
messageCountObserver: observer('messages.[]', function () {
|
2015-05-21 11:03:24 -06:00
|
|
|
this.sendAction('notify', this.get('messages').length);
|
|
|
|
})
|
|
|
|
});
|