Site-wide

Site header

API

SiteHeader

Parameters

  • element HTMLElement DOM element for component instantiation and scope

  • options 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, default true)
    • options.attachKeyListener Boolean Whether or not to bind keyboard events (optional, default true)
    • options.containerSelector (optional, default '[data-ecl-site-header-top]')

init

Initialise component.

destroy

Destroy component.

openOverlay

Shows the modal language list overlay.

closeOverlay

Hides the modal language list overlay.

toggleOverlay

Toggles the modal language list overlay.

Parameters

toggleSearch

Toggles the search form.

Parameters

toggleLogin

Toggles the login form.

Parameters

handleKeyboardGlobal

Handles global keyboard events, triggered outside of the site header.

Parameters

handleClickGlobal

Handles global click events, triggered outside of the site header.

Parameters

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.