API
SiteHeader
Parameters
element
HTMLElement DOM element for component instantiation and scopeoptions
Object (optional, default{}
)options.languageLinkSelector
String (optional, default'[data-ecl-language-selector]'
)options.languageListOverlaySelector
String (optional, default'[data-ecl-language-list-overlay]'
)options.languageListEuSelector
String (optional, default'[data-ecl-language-list-eu]'
)options.languageListNonEuSelector
String (optional, default'[data-ecl-language-list-non-eu]'
)options.closeOverlaySelector
String (optional, default'[data-ecl-language-list-close]'
)options.searchToggleSelector
String (optional, default'[data-ecl-search-toggle]'
)options.searchFormSelector
String (optional, default'[data-ecl-search-form]'
)options.loginToggleSelector
String (optional, default'[data-ecl-login-toggle]'
)options.loginBoxSelector
String (optional, default'[data-ecl-login-box]'
)options.attachClickListener
Boolean Whether or not to bind click events (optional, defaulttrue
)options.attachKeyListener
Boolean Whether or not to bind keyboard events (optional, defaulttrue
)options.attachResizeListener
Boolean Whether or not to bind resize events (optional, defaulttrue
)options.containerSelector
(optional, default'[data-ecl-site-header-top]'
)
init
Initialise component.
destroy
Destroy component.
updateOverlay
Update display of the modal language list overlay.
openOverlay
Shows the modal language list overlay.
closeOverlay
Hides the modal language list overlay.
toggleOverlay
Toggles the modal language list overlay.
Parameters
e
Event
handleResize
Trigger events on resize Uses a debounce, for performance
handleKeyboardLanguage
Handles keyboard events specific to the language list.
Parameters
e
Event
toggleSearch
Toggles the search form.
Parameters
e
Event
toggleLogin
Toggles the login form.
Parameters
e
Event
handleKeyboardGlobal
Handles global keyboard events, triggered outside of the site header.
Parameters
e
Event
handleClickGlobal
Handles global click events, triggered outside of the site header.
Parameters
e
Event
autoInit
Parameters
root
HTMLElement DOM element for component instantiation and scope$1
Object (optional, default{}
)$1.SITE_HEADER_CORE
(optional, default{}
)
Returns SiteHeader An instance of SiteHeader.