Origami Frontend Components & Services

JSDoc: o-comments

o-comments is not maintained by the Origami team. This means that the Origami team will not necessarily be able to help you with support requests. The people who maintain this component may be able to offer support, but it's not guaranteed.

new Count(countEl, opts)

Class constructor.

parameter type default description
countEl (optional) HTMLElement The component element in the DOM
opts (optional) Object {} An options object for configuring the component

Methods

Links

new Stream(streamEl, opts)

Class constructor.

parameter type default description
streamEl (optional) HTMLElement The component element in the DOM
opts (optional) Object {} An options object for configuring the component

Methods

Links

Comments.getDataAttributes(rootEl)

Static Method

Get the data attributes from the element. If the component is being set up declaratively, this method is used to extract the data attributes from the DOM.

parameter type default description
rootEl HTMLElement The component element in the DOM

Returns

  • Object - - Data attributes as an object

Links

Comments.init(rootEl, opts)

Static Method

Initialise the component.

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

Returns

  • Comments | Array.<Comments> - - Comments instance(s)

Links

Count.getCountLabel(count)

Static Method

Get the aria-label for the count element.

parameter type default description
count Number The comment count

Returns

  • String - The string that should be used as the aria-label

Links

Stream#publishEvent(name, data)

Instance Method

Emits events that have a valid o-comment event name.

parameter type default description
name String The event name
data Object The event payload

Returns

  • void

Links

Status
active Origami v1
Switch component view

GitHub Repository

Install o-comments

If using the Build Service, add o-comments@^7.7.4 to your script and link tags.

If running a Manual Build, run npm install "o-comments@^7.7.4".

Help & Support

o-comments is not supported directly by the Origami team. We make no guarantees, but will help if we can. First try contacting its maintainers at:

Slack: #content-innovation
Email: content-innovation-team.customer-products@ft.com