DomDelegate

Global Property

global require,module

Links

new Share(...)

parameter type default description
el (optional) HTMLElement | string document.body Element where to search for an o-share component. You can pass an HTMLElement or a selector string
config Object Optional
config.url string Optional, url to share
config.title string Optional, title to be used in social network sharing
config.titleExtra string Optional, extra bit to add to the title for some social networks
config.summary string Optional, summary of the page that's being shared
config.relatedTwitterAccounts string Optional, extra information for sharing on Twitter
config.links Array.<Object> Optional, array of strings of supported social network names that you want rendered

Methods

  • init - (inner) Initialises the Share class, rendering the o-share element if it's empty with [config](#config) options, or from corresponding data attributes and sets up dom-delegates. Dispatches 'oShare.ready' at the end
  • destroy - (instance) Destroys the Share instance, disables dom-delegates
  • init(el) - (static) Initialises all o-share components inside the element passed as the first parameter

Links

Share~init

Inner Function

Initialises the Share class, rendering the o-share element if it's empty with config options, or from corresponding data attributes and sets up dom-delegates. Dispatches 'oShare.ready' at the end

Links

Share#destroy

Instance Method

Destroys the Share instance, disables dom-delegates

Links

Share.init(el)

Static Method

Initialises all o-share components inside the element passed as the first parameter

parameter type default description
el (optional) HTMLElement | string document.body Element where to search for o-share components. You can pass an HTMLElement or a selector string

Returns

  • Array - - An array of Share instances

Links