Skip to content

Module: src/util/PopupWrapper

Extended wrapper for the internal Popup class that adapts behavior based on the player layout. If the layout is set to 'controller-only', the popup will not apply layout-limiting behavior, so that the popup can be outside of the players viewport. It also adds or removes a CSS class on the player's container to allow further layout adaptations.

Version
1.0.0
Author
Frank Kudermann - alphanull
License
MIT
Extends
Popup
Requires
Popup
Source
PopupWrapper.js, line 14

Constructor

new PopupWrapper(player, rootEle, options, apiKeyopt)

Creates a new PopupWrapper instance.

Parameters:
Name Type Attributes Description
player Player

Reference to the VisionPlayer instance.

rootEle HTMLElement

Reference to the parent root element.

options Object

Additional options.

apiKey symbol optional

Token for extended access to the player API.

Members

Reference to the main player instance.

Type
Player
Source
PopupWrapper.js, line 20

Reference to the player's root element.

Type
HTMLElement
Source
PopupWrapper.js, line 26

Secret key only known to the player instance and initialized components. Used to be able to restrict access to API methods in conjunction with secure mode.

Type
symbol
Source
PopupWrapper.js, line 33

Methods

show(content, eventOrTarget, optionsopt)

Shows the popup with specified content and alignment target. Adds a CSS class to the player container for visual indication.

Parameters:
Name Type Attributes Description
content string | HTMLElement | DocumentFragment

The content to display in the popup.

eventOrTarget Event | HTMLElement | DocumentFragment

The event or element that triggered the popup.

options Popup~options optional

Configuration overrides for this invocation.

Source
PopupWrapper.js, line 61

onVisible()

Called when showing is completed (ie transition has ended).

Source
PopupWrapper.js, line 73

onHidden()

Called when hiding is completed (ie transition has ended). Removes the CSS class from the player container.

Source
PopupWrapper.js, line 84

Events

popup/show

This event is fired when the Popup is shown.

Listeners
UI#disableAutoHide
Source
PopupWrapper.js, line 95

popup/hidden

This event is fired when the Popup is hidden.

Source
PopupWrapper.js, line 100