From: Kevin Ball Date: Mon, 3 Oct 2016 21:36:55 +0000 (-0700) Subject: Fix up behavior when element has open submenu X-Git-Tag: v6.2.4-rc2~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1036dcd5a18cfc66e37f9e3c51f457afffb7ac88;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix up behavior when element has open submenu --- 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();