From: Marius Olbertz Date: Thu, 12 Jan 2017 16:37:19 +0000 (+0100) Subject: Fixed ESC button on drilldown menus. X-Git-Tag: v6.3.1-rc1~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9635%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fixed ESC button on drilldown menus. Previously, _back was being called without a parameter which is both a wrong ca$ ESC is now using _hide and will place focus on the anchor that was used to open$ TBD: If hideAll should be called so all sub menus are closed using ESC. --- diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index 3b7802d69..16c19ceac 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -234,8 +234,11 @@ class Drilldown { return true; }, close: function() { - _this._back(); - //_this.$menuItems.first().focus(); // focus to first element + // Don't close on element in root ul + if (!$element.is(_this.$element.find('> li > a'))) { + _this._hide($element.parent().parent()); + $element.parent().parent().siblings('a').focus(); + } }, open: function() { if (!$element.is(_this.$menuItems)) { // not menu item means back button