Ghost/core/client/components/gh-tab.js
Jason Williams 0f17378b26 Enable JSCS checking on client.
Refs #4001
- grunt-jscs@0.8.1 which provides ES6 support.
2014-10-25 16:13:04 +00:00

31 lines
845 B
JavaScript

// See gh-tabs-manager.js for use
var Tab = Ember.Component.extend({
tabsManager: Ember.computed(function () {
return this.nearestWithProperty('isTabsManager');
}),
active: Ember.computed('tabsManager.activeTab', function () {
return this.get('tabsManager.activeTab') === this;
}),
index: Ember.computed('tabsManager.tabs.@each', function () {
return this.get('tabsManager.tabs').indexOf(this);
}),
// Select on click
click: function () {
this.get('tabsManager').select(this);
},
// Registration methods
registerWithTabs: function () {
this.get('tabsManager').registerTab(this);
}.on('didInsertElement'),
unregisterWithTabs: function () {
this.get('tabsManager').unregisterTab(this);
}.on('willDestroyElement')
});
export default Tab;