]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fixed ESC button on drilldown menus. 9635/head
authorMarius Olbertz <marius.olbertz@gmail.com>
Thu, 12 Jan 2017 16:37:19 +0000 (17:37 +0100)
committerMarius Olbertz <marius.olbertz@gmail.com>
Thu, 12 Jan 2017 16:37:19 +0000 (17:37 +0100)
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.

js/foundation.drilldown.js

index 3b7802d69620556b2389d2768a1627d0b675f873..16c19ceace5d193a464d420ffc6033c0f3050044 100644 (file)
@@ -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