Openlands Projects
Our projects strive to give back to our region’s open spaces and create new ones so that we can continue to enjoy their solace and health benefits for generations to come.
"
*
* REMOVE any old "click-only-menu" script that was previously attached.
*/
(function () {
function initMobileMenuFixes() {
// FIX 1: Clicking parent menu label (e.g. "Accountability & Impact") toggles
// the submenu instead of closing the drawer.
// Uses document capture so we intercept before Astra's close-on-click handler.
document.addEventListener('click', function (e) {
var link = e.target.closest('#ast-mobile-popup-wrapper .menu-item-has-children > a.menu-link');
if (!link) return;
if (link.getAttribute('href') !== '#') return; // only intercept non-navigation parents
e.preventDefault();
e.stopImmediatePropagation(); // prevent any other listeners on same phase/element
var li = link.closest('.menu-item-has-children');
var toggle = li ? li.querySelector(':scope > .ast-menu-toggle') : null;
if (toggle) {
// Works even when toggle is display:none — dispatchEvent bypasses CSS visibility
toggle.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
}
}, true); // capture phase on document — fires before Astra's bubble-phase handlers
// FIX 2: Wrap the drawer logo (currently an unlinked