Life Ring Button (new beta)

Description

This JS API provides you access to the new Life Ring Button tool. Access methods on this object:

productFruits.api.inAppCenter

Methods

open(opts)

Expands the Life Ring Button. It can receive an options object, see this example:

window.productFruits.api.inAppCenter.open({
	focus: { 
		articleId: 12345 // it will open the Life Ring Button focused to the particular article
	}
})

close()

Closes the Life Ring Button.

isOpened()

Returns true if the Life Ring Button is opened, false if it is not.

attachToCustomElement(elementInstance)

Attaches the Life Ring to a custom element in your application. It automatically hides the default launcher button. The argument must be an element instance, not a CSS selector.

listen(event, callback)

Listens to a Life Ring Button event and calls the callback. Supported events are closed - this event is triggered when the Life Ring Button is closed; opened - triggered when the modal is opened.