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

Version Path
logster-2.1.0 client-app/app/components/tabbed-section.js
logster-2.0.1 client-app/app/components/tabbed-section.js
logster-2.0.0.pre client-app/app/components/tabbed-section.js
logster-1.4.0.pre client-app/app/components/tabbed-section.js
logster-1.3.4 client-app/app/components/tabbed-section.js
logster-1.3.3 client-app/app/components/tabbed-section.js
logster-1.3.2 client-app/app/components/tabbed-section.js
logster-1.3.0 client-app/app/components/tabbed-section.js
logster-1.3.pre client-app/app/components/tabbed-section.js