Developers use cases
This document describes the use cases for developers to interact with the Flash Widget.
How to know when the Flash Widget is ready
You can subscribe to the onliveFlashWidgetReady
event to know when the Flash Widget is ready to be used.
window.addEventListener("onliveFlashWidgetReady", () => console.log('Flash Widget is ready!!!'))
Onlive create the onliveManager
object that contains the services
object with the list of services available. The onliveFlashWidget
is in this case the service that manages the Flash Widget.
How to open the widget on a specific node
You can open the Flash Widget on a specific node by calling the show
method on the Flash Widget panel. In this example we are opening the Flash Widget on the booking
node and passing the dealerId
parameter.
onliveManager.services.onliveFlashWidget.panel.show('booking', {'dealerId': '1234'})
How to hide and show the widget
You can hide and show the Flash Widget by calling the hide
or show
methods on the Flash Widget IButton object.
Hide and show the widget programmatically
// Hide the widget
onliveManager.services.onliveFlashWidget.IButton.hide()
// Show the widget
onliveManager.services.onliveFlashWidget.IButton.show()
Init with the widget hidden
You can add this configuration in the FlashWidget installation config. This will hide the widget when the page is loaded and the path matches any of the paths in the hiddenPaths
array.
"hiddenPaths": [
"/discover/live-tour",
"/existing-user-live-tour",
"/new-user-live-tour",
"/fleet-live-tour"
],