Origami Frontend Components & Services

JSDoc: o-header-services

new Drawer(headerEl)

Class constructor.

parameter type default description
headerEl (optional) HTMLElement The component element in the DOM

Methods

Properties

  • enabled - Check if the drawer is currently enabled. If the burger element is visible, the drawer is enabled.

Links

new HeaderServices(headerEl)

Class constructor

parameter type default description
headerEl (optional) HTMLElement The component element in the DOM

Methods

Links

new Scroll(headerEl)

Class constructor

parameter type default description
headerEl (optional) HTMLElement The component element in the DOM

Methods

Links

Drawer#handleEvent(event)

Instance Method

Event Handler

parameter type default description
event object The event emitted by element/window interactions

Returns

  • void

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

  • void

Links

Drawer#toggleDrawer

Instance Method

Drawer hide/show functionality

Returns

  • void

Links

HeaderServices.init(rootElement, options)

Static Method

Initialise header component

parameter type default description
rootElement HTMLElement | string The root element to intialise the component in, or a CSS selector for the root element
options (optional) object {} An options object for configuring the component

Returns

  • Array.<HTMLElement> | HTMLElement - - The header(s) initalised.

Links

Scroll#render

Instance Method

Scroll functionality rendering

Returns

  • void

Links

Scroll#toggleScrollButtons

Instance Method

Hide/show scroll buttons

Returns

  • void

Links

Scroll#scroll(event)

Instance Method

Scrolling functionality

parameter type default description
event object A scroll event

Returns

  • void

Links

Scroll#showCurrentSelection

Instance Method

Scroll secondary nav to 'current selection'

Returns

  • void

Links

Status
active
Switch component view

GitHub: o-header-services@5.2.4

Install o-header-services

If using the Build Service, add o-header-services@^5.2.4 to your script and link tags.

If using the npm package manager for a Manual Build, run npm install --save-peer "@financial-times/o-header-services@^5.2.4".

Help & Support

o-header-services is maintained directly by the Origami team. If you have any questions about o-header-services or Origami in general, we are happy to help. 😊

Slack: #origami-support
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #origami-support
Email: origami.support@ft.com