]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
re-add aria attributes for drilldown specifically
authorKevin Ball <kmball11@gmail.com>
Wed, 30 Nov 2016 22:13:33 +0000 (14:13 -0800)
committerKevin Ball <kmball11@gmail.com>
Wed, 30 Nov 2016 22:13:33 +0000 (14:13 -0800)
js/foundation.util.nest.js

index 3582a43ee290d308670771a65dc308830b2b3200..83cf95f4a7faade0717869449926eb8e7a456e7a 100644 (file)
@@ -22,6 +22,12 @@ const Nest = {
             'aria-haspopup': true,
             'aria-label': $item.children('a:first').text()
           });
+          // Note:  Drilldowns behave differently in how they hide, and so need
+          // additional attributes.  We should look if this possibly over-generalized
+          // utility (Nest) is appropriate when we rework menus in 6.4
+          if(type === 'drilldown') {
+            $item.attr({'aria-expanded': false});
+          }
 
         $sub
           .addClass(`submenu ${subMenuClass}`)
@@ -29,6 +35,9 @@ const Nest = {
             'data-submenu': '',
             'role': 'menu'
           });
+        if(type === 'drilldown') {
+          $sub.attr({'aria-hidden': true});
+        }
       }
 
       if ($item.parent('[data-submenu]').length) {