Skip to main content

buildfire.components.popup

This component provides a rich modal for plugins.

Requirements

Widget

<head>
<!-- ... -->
<script src="../../../../scripts/buildfire.js"></script>
<script src="../../../scripts/buildfire/components/popup/popup.js"></script>
</head>

Methods

display()

buildfire.components.popup.display(options, callback)

Displays a popup

buildfire.components.popup.display(
{
title: "Popup title",
richContent: "Hello I am rich content!",
},
(err, result) => {
if (err) return console.error(err);

console.log(result);
}
);

options

NameTypeRequiredDescriptionDefault
titlestringnoDialog title.
subtitlestringnoDialog subtitle. If empty, no subtitle will be displayed
showDismissButtonbooleannoIf true, shows a dismiss button in dialog footertrue
actionobjectnoAction Item. Will show as additional button.
richContentstringnoMessage or html to be displayed inside of the dialog
designobjectnoDialog design configuration
options.design
NameTypeRequiredDescriptionDefault
titleobjectnoDialog title css as object. ex. ({ align: 'center' })
fullScreenbooleannoControls if dialog takes up full screenfalse
textColorstringnoDialog text colorinherits from theme
backgroundColorstringnoDialog background colorinherits from theme

callback(err, result)

Callback function after the end user clicked on button.

NameTypeDescription
errstringerror string, null when operation is successful
resultobjectThis value is always null since there is only one button that can be clicked
result
NameTypeDescription
buttonTypestring"dismiss" or "action"
valueobjectValue of the action