popup

Playtech.API. popup

Methods

# (static) closePageAsPopup()

Close page which is displayed as popup.
Example
Playtech.API.popup.closePageAsPopup();

# (static) closePopups(shortcutOrParamsopt)

Closes one, several or all popups depending on passed params.
Parameters:
Name Type Attributes Description
shortcutOrParams Object | string <optional>
Properties
Name Type Attributes Description
popups Array.<string> <optional>
exclude Array.<string> <optional>
excludeLayers Array.<string> <optional>
Examples
// will close single popup with ID 'mySpecificPopupID'
smartClosePopups('mySpecificPopupID');
// will close all popups except for PLAYER_FREEZE_ACCOUNT_POPUP, LOGOUT_NOTIFICATION_POPUP, USER_VERIFY_POPUP
smartClosePopups('logout');
// will close all popups except for WELCOME_POPUP popup and any popups
// that are part of ADVANCED_PLAYER_MESSAGE and ADVANCED_PLAYER_MESSAGE_MODAL layers
smartClosePopups('gameLaunch');
// will close popups according to provided criteria
smartClosePopups({
    popups: ['popupToClose1', 'popupToClose2'],
    exclude: ['popupToStay1', 'popupToStay2'],
    excludeLayers: ['layerToStay1', 'layerToStay2']
});
// will close all popups
smartClosePopups();

# (static) disablePopups()

Disable all popups. Any popups that will be issued will not be visible. But as soon as popups will be enabled -- all issued previous popups will become visible.
Example
Playtech.API.popup.disablePopups();

# (static) enablePopups()

Enable all popups. All popups issued previously will become visible. If this is not desired, please invoke {#closePopups} before.
Example
Playtech.API.popup.enablePopups();

# (static) showPopup(popupTypeopt, params)

Show a popup. A few popup types are supported:

'common' popup by default shows only one button with default text which just closes the popup. supported params: id, content, onClose, btnTitle, closeAll, layer, isModal, articleId, onOverlayClick, layerClassNames, buttons, children, controls, title, onTouchStart, className, classNames, style, iconType

'transparent' popup is just like a common popup, but without the popup's background structure. supported params: id, content, onClose, btnTitle, closeAll, layer, isModal, articleId, onOverlayClick, layerClassNames, buttons, children, controls, title, onTouchStart, className, classNames, style, iconType

'confirmation' popup by default shows only two buttons with default text, however it is possible to override texts and actions when clicked. supported params: title, onClose, onAccept, controls, onDecline, articleId, content, acceptBtnText, declineBtnText, onOverlayClick, layerClassNames, buttons, children, controls, onTouchStart, className, classNames, style, iconType

'login' popup just shows the login popup. supported params: onClose, onLogin, title

'jumioVerificationStatus' popup with predefined title and content depends on status property passed to options. supported params:status

'logoutNotification' after logout message popup supported params: isLoginAgainPopup, onAccept, onDecline, className

'twoFactorAuthentication' popup with TwoFactorAuthentication component supported params: id, title, templateId, controls, onSuccess, resendHandler, onClose

'bonusBuyIn' bonus popup supported params: title, bonusCode, buyInWebContentId, termAndConditionWebContentId, layerClassNames, buttons, children, controls, title, onTouchStart, className, classNames, style, iconType, onClose, onOverlayClick 'gamblingSessionLimits' popup with GamblingSessionLimits component supported params: onSuccessLimitsSet 'questionnaire' popup with list of questions required before increase player's limits supported params: id, title, onClose, onSuccess, formName, tkPrefix, daydepositlimit, weekdepositlimit, monthdepositlimit 'simpleDialogInfo' popup to interact with "actionShowSimpleDialogInfo" data structures supported params: message, actionId, layer, acceptBtnText, declineBtnText, afterSubmitAction
Parameters:
Name Type Attributes Default Description
popupType string <optional>
common 'common', 'confirmation', 'transparent', 'login', 'jumioVerificationStatus', 'logoutNotification', 'twoFactorAuthentication', 'bonusBuyIn', 'gamblingSessionLimits', 'questionnaire', 'simpleDialogInfo'.
params Object Parameters for the popup available for all popupTypes.
Properties
Name Type Attributes Default Description
id string <optional>
id of the popup.
title string <optional>
Title of the popup.
content string <optional>
Contents of the popup.
articleId string <optional>
ID of the Web Content from the CMS to show instead of content.
isModal boolean <optional>
true Whether to show 'close' button.
onClose function <optional>
Callback function to process when player clicks 'close' button.
buttons Array.<Object> <optional>
Buttons of the popup. Empty array "[]" specified for popup without buttons. If buttons param is not specified - popup will show the default "OK" button.
Properties
Name Type Attributes Description
id string <optional>
onClick function <optional>
className string <optional>
text string
view string <optional>
Values: 'primary', 'secondary', 'readonly'.
color string <optional>
Values: 'success', 'negative', 'info', 'revert', 'generic'.
size string <optional>
Values: 'large', 'medium', 'small'.
acceptBtnText string <optional>
Translation key or text to show on 'accept' button.
declineBtnText string <optional>
Translation key or text to show on 'decline' button.
onAccept function <optional>
Callback function to process when player clicks 'accept' button.
onDecline function <optional>
Callback function to process when player clicks 'decline' button.
status string <optional>
Jumio status.
isLoginAgainPopup string <optional>
Popup type to 'confirmation'.
className boolean <optional>
{string} Providing styles to popup.
id string <optional>
Will be passed to TwoFactorAuthentication component as property.
title string <optional>
be passed to TwoFactorAuthentication component as property.
templateId string <optional>
Will be passed to TwoFactorAuthentication component as property. Values: 'two_factor_email', 'two_factor_sms'.
controls Object <optional>
Will be passed to popup wrapper for controls.
Properties
Name Type Attributes Description
onPrev function <optional>
onNext function <optional>
label string <optional>
onSuccess function <optional>
Callback after success iapiValidateTwoFactorToken request.
resendHandler function <optional>
Function called on resend code flow.
btnTitle string <optional>
Button title.
closeAll boolean <optional>
Whether other popups should be closed.
layer string <optional>
Layer witch should be used, this parameter should be used carefully.
onLogin function <optional>
Callback after success login process.
Examples
Playtech.API.popup.showPopup({
    title: 'Title',
    content: 'Very important message!'
});
Playtech.API.popup.showPopup('confirmation', {
    content: 'Would you accept this confirmation?',
    onAccept: () => {
        // do something if player accepts
    }
});