new Drawer(headerEl)
Class constructor.
Methods
Properties
-
enabled
-
Check if the drawer is currently enabled.
If the burger element is visible, the drawer is enabled.
Links
new DropDown(headerEl, drawer)
Class constructor
Methods
-
handleEvent(event)
- (instance) Event Handler
-
isDrawer
- (instance) Checks if primary nav is in a drawer
This boolean will change the drop down behaviour.
-
reset
- (instance) Returns nav items to their original collapsed state,
items which contain links with the attribute `aria-current`
set to true remain expanded.
-
isExpanded(item)
- (static) Checks whether nav menu is expanded
-
expand(item)
- (static) Expands closed nav menu
-
position(item)
- (static) Changes nav menu position relative to the window
-
collapse(item)
- (static) Collapses open nav menu
-
collapseAll(items)
- (static) Collapses all open nav menus
-
expandAll(items)
- (static) Expands all open nav menus
-
getCurrent(items)
- (static) Returns items which contain an anchor
with the attribute `aria-current` set to true or "page".
Properties
-
navItems
- (type: Array.<Element>)
- Nav items with a dropdown.
Links
Drawer#handleEvent(event)
Instance Method
Event Handler
Returns
Links
Drawer#enabled
Instance Property
Check if the drawer is currently enabled.
If the burger element is visible, the drawer is enabled.
Links
Drawer#render
Instance Method
Drawer rendering
Returns
Links
Drawer#toggleDrawer
Instance Method
Drawer hide/show functionality
Returns
Links
DropDown#navItems
Instance Property
Type
- Nav items with a dropdown.
Links
DropDown#handleEvent(event)
Instance Method
Event Handler
Returns
Links
DropDown#isDrawer
Instance Method
Checks if primary nav is in a drawer
This boolean will change the drop down behaviour.
Returns
-
boolean
- - whether the drawer is enabled or not
Links
DropDown#reset
Instance Method
Returns nav items to their original collapsed state,
items which contain links with the attribute aria-current
set to true remain expanded.
Returns
Links
DropDown.isExpanded(item)
Static Method
Checks whether nav menu is expanded
Returns
-
boolean
- - whether the nav menu is expanded
Links
DropDown.expand(item)
Static Method
Expands closed nav menu
Returns
Links
DropDown.position(item)
Static Method
Changes nav menu position relative to the window
Returns
Links
DropDown.collapse(item)
Static Method
Collapses open nav menu
Returns
Links
DropDown.collapseAll(items)
Static Method
Collapses all open nav menus
Returns
Links
DropDown.expandAll(items)
Static Method
Expands all open nav menus
Returns
Links
DropDown.getCurrent(items)
Static Method
Returns items which contain an anchor
with the attribute aria-current
set to true or "page".
Returns
-
HTMLElement
- - The current menu item
Links