From 1036dcd5a18cfc66e37f9e3c51f457afffb7ac88 Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Mon, 3 Oct 2016 14:36:55 -0700 Subject: [PATCH] Fix up behavior when element has open submenu --- js/foundation.accordionMenu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/foundation.accordionMenu.js b/js/foundation.accordionMenu.js index d1eeeb5a7..460dc33f2 100644 --- a/js/foundation.accordionMenu.js +++ b/js/foundation.accordionMenu.js @@ -115,8 +115,8 @@ class AccordionMenu { } if ($(this).is(':first-child')) { // is first element of sub menu $prevElement = $element.parents('li').first().find('a').first(); - } else if ($prevElement.children('[data-submenu]:visible').length) { // if previous element has open sub menu - $prevElement = $prevElement.find('li:last-child').find('a').first(); + } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { // if previous element has open sub menu + $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first(); } if ($(this).is(':last-child')) { // is last element of sub menu $nextElement = $element.parents('li').first().next('li').find('a').first(); -- 2.47.2