2017-12-15 21:39:18 +00:00
|
|
|
import Controller from '@ember/controller';
|
|
|
|
import { computed } from '@ember/object';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
export default Controller.extend({
|
|
|
|
activeTab: 'tags',
|
|
|
|
|
2017-10-24 18:29:00 +00:00
|
|
|
sortedTags: computed('model.tags', function() {
|
|
|
|
const tags = this.get('model.tags') || {};
|
|
|
|
return Object.keys(tags)
|
|
|
|
.map(name => ({
|
|
|
|
name,
|
|
|
|
value: tags[name],
|
|
|
|
}))
|
|
|
|
.sortBy('name');
|
|
|
|
}),
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
actions: {
|
|
|
|
setTab(tab) {
|
|
|
|
this.set('activeTab', tab);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|