Replace Alpine.js with Stimulus controller for header navigation
- Create header_controller.js to handle mobile menu and user dropdown - Replace Alpine.js directives with Stimulus data attributes in header component - Add proper event handling for click outside to close menus - Maintain all existing functionality with improved code consistency
This commit is contained in:
@@ -2,10 +2,8 @@
|
||||
// Run that command whenever you add a new controller or create them with
|
||||
// ./bin/rails generate stimulus controllerName
|
||||
|
||||
// Import the main Stimulus application
|
||||
import { application } from "./application"
|
||||
|
||||
// Import all controllers
|
||||
import LogoutController from "./logout_controller";
|
||||
application.register("logout", LogoutController);
|
||||
|
||||
@@ -18,6 +16,9 @@ application.register("flash-message", FlashMessageController);
|
||||
import TicketSelectionController from "./ticket_selection_controller"
|
||||
application.register("ticket-selection", TicketSelectionController);
|
||||
|
||||
import HeaderController from "./header_controller"
|
||||
application.register("header", HeaderController);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user