diff --git a/app/javascript/controllers/toggle_controller.js b/app/javascript/controllers/toggle_controller.js index 071e9c3d..1849197d 100644 --- a/app/javascript/controllers/toggle_controller.js +++ b/app/javascript/controllers/toggle_controller.js @@ -4,3 +4,19 @@ export default class extends Controller { static targets = [ "menu" ] static values = {isOpen: { type: Boolean, default: false }} + connect(){} + + menu() { + this.isOpenValue ? this.hide() : this.show() + this.isOpenValue = !this.isOpenValue + } + + show() { + this.menuTarget.style.display = "block" + } + + hide() { + this.menuTarget.style.display = "none" + } + +}