Sha256: 7b9a227db2106f89ab74d5512b2421d351bc46ae107f007f93593539371ff858
Contents?: true
Size: 710 Bytes
Versions: 9
Compression:
Stored size: 710 Bytes
Contents
import Component from "@ember/component"; export default Component.extend({ tabs: Em.A(), selectTab(view) { if (view.get("isLink")) { this.triggerAction(view.get("action")); return; } const selected = this.get("selected"); if (selected) { selected.set("active", false); } this.set("selected", view); view.set("active", true); }, addTab(tab) { this.get("tabs").addObject(tab); if (!this.get("selected") && !tab.get("isLink")) { this.selectTab(tab); } }, removeTab(tab) { if (this.get("selected") === tab) { this.set("selected", null); } this.get("tabs").removeObject(tab); } });
Version data entries
9 entries across 9 versions & 1 rubygems