Sha256: 42d7ee41bebc333d572637fe5a3ae3a1bb5bdabdd8819bad86165c324182646b
Contents?: true
Size: 815 Bytes
Versions: 7
Compression:
Stored size: 815 Bytes
Contents
import { CocoComponent } from "@assets/js/shared/coco.js"; import { getComponent } from "@helpers/alpine"; export default CocoComponent("buttonDropdown", () => { return { dropdown: null, button: null, init() { this.$nextTick(() => { this.button = getComponent(this.$el.querySelector(".coco-button")); }); }, hideDropdown() { if (this.dropdown) { this.dropdown.hide(); } }, showDropdown() { if (this.dropdown) { this.dropdown.show(); } }, /* bindings */ root: { "@dropdown:show": "button.setState('active')", "@dropdown:hide": "button.resetState()", "@confirmation:confirm": "button.approveAndRun($event)", "@confirmation:cancel": "button.cancelConfirmation($event)", }, }; });
Version data entries
7 entries across 7 versions & 1 rubygems