--- a/cms/app-client/app/components/notice-component.js Tue Jul 05 01:30:27 2016 +0200
+++ b/cms/app-client/app/components/notice-component.js Tue Jul 05 16:53:04 2016 +0200
@@ -6,14 +6,14 @@
classNames: ['notice-component'],
- item: Ember.computed('player.model', function() {
- return this.get('player').get('model');
+ item: Ember.computed('model', 'player.model', function() {
+ return this.get('model') || this.get('player').get('model');
}),
- participants: Ember.computed('player.model.contributors', function() {
+ participants: Ember.computed('item.contributors', function() {
var participants = [];
- if(this.get('player').get('model')) {
- this.get('player').get('model').get('contributors').forEach(function(contributor) {
+ if(this.get('item')) {
+ this.get('item').get('contributors').forEach(function(contributor) {
if(contributor.name) {
participants.push({ name: contributor.name, role: contributor.role.split('/').pop() });
}
@@ -22,15 +22,23 @@
return participants;
}),
- location: Ember.computed('player.model.geoInfo', function() {
+ location: Ember.computed('item.geoInfo', function() {
var location = '';
- if(this.get('player').get('model')) {
- var meta = this.get('player').get('model').get('geoInfo').notes.find(element => element.lang);
+ if(this.get('item')) {
+ var meta = this.get('item').get('geoInfo').notes.find(element => element.lang);
if(meta) {
location = meta.value;
}
}
return location;
- })
+ }),
+
+ actions: {
+
+ close: function() {
+ this.set('model', null);
+ }
+
+ }
});