Sha256: d030d09d71f0545c987b471cb75d8698528be49b4a86aa8186d21ec26c3119e2

Contents?: true

Size: 571 Bytes

Versions: 22

Compression:

Stored size: 571 Bytes

Contents

import { CocoComponent } from "@assets/js/coco/component";
import { getData } from "@helpers/alpine";

export default CocoComponent("layoutPickerButton", ({ selected }) => {
  return {
    selectedLayout: selected,

    getPicker() {
      return getData(
        this.$root.querySelector("[data-role='layout-picker']")
          .firstElementChild
      );
    },

    getButton() {
      return getData(this.$root.querySelector(".layout-picker-trigger"));
    },

    init() {
      this.$watch("selectedLayout", () => this.getButton().hideDropdown());
    },
  };
});

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.7 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.6 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.5 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.4 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.3 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.2 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.1 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.19.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.18.8 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.18.7 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.18.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.7 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.6 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.5 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.4 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.3 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.2 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.1 app/components/coco/buttons/layout_picker_button/layout_picker_button.js
coveragebook_components-0.17.0 app/components/coco/buttons/layout_picker_button/layout_picker_button.js