Sha256: 382239739ff23253d4e02b27c171fc1b50bf2566927c5affbc59facb2e3d9a73
Contents?: true
Size: 822 Bytes
Versions: 15
Compression:
Stored size: 822 Bytes
Contents
import classic from "ember-classic-decorator"; import Component from "@ember/component"; import { A } from "@ember/array"; import { action } from "@ember/object"; @classic export default class TabbedSection extends Component { tabs = A(); selected = null; @action selectTab(tab) { if (tab.isLink) { this.triggerAction(tab.action); return; } if (this.selected) { this.selected.set("active", false); } this.set("selected", tab); tab.set("active", true); this.onTabChange(tab.name); } @action addTab(tab) { this.tabs.addObject(tab); if (!this.selected && !tab.isLink) { this.selectTab(tab); } } @action removeTab(tab) { if (this.selected === tab) { this.set("selected", null); } this.tabs.removeObject(tab); } }
Version data entries
15 entries across 15 versions & 1 rubygems