refactor: Add scrollToSection and fix missing functions

- Add scrollToSection() to utils._hs (was missing after cv-functions.js removal)
- Move error toast close handler to inline hyperscript
- Remove initMenuCloseOnClick() - now integrated into scrollToSection()
- Remove initErrorToastClose() - now hyperscript inline handler
- Remove unused initScrollBehaviorJS() fallback (~70 lines dead code)

This fixes the navigation menu scroll functionality and eliminates
more JavaScript in favor of hyperscript.
This commit is contained in:
juanatsap
2025-11-30 06:06:10 +00:00
parent 7ab150a48e
commit cf6b825bde
3 changed files with 22 additions and 94 deletions
+18
View File
@@ -170,6 +170,24 @@ def setFooterHover(show)
end
end
-- ==============================================================================
-- NAVIGATION SCROLL
-- ==============================================================================
-- Smooth scroll to a section by ID
def scrollToSection(evt, sectionId)
if evt then call evt.preventDefault() end
set el to document.getElementById(sectionId)
if el is not null
call el.scrollIntoView({ behavior: 'smooth' })
-- Close the menu after navigation
set menu to document.querySelector('.navigation-menu')
if menu is not null
remove .menu-hover from menu
remove .menu-open from menu
end
end
end
-- ==============================================================================
-- KEYBOARD SHORTCUTS
-- ==============================================================================