This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/edit-category-tab.js.es6
2015-08-10 10:21:05 -04:00

27 lines
641 B
JavaScript

import { propertyEqual } from 'discourse/lib/computed';
export default Em.Component.extend({
tagName: 'li',
classNameBindings: ['active', 'tabClassName'],
tabClassName: function() {
return 'edit-category-' + this.get('tab');
}.property('tab'),
active: propertyEqual('selectedTab', 'tab'),
title: function() {
return I18n.t('category.' + this.get('tab').replace('-', '_'));
}.property('tab'),
_addToCollection: function() {
this.get('panels').addObject(this.get('tabClassName'));
}.on('didInsertElement'),
actions: {
select: function() {
this.set('selectedTab', this.get('tab'));
}
}
});