Adding a Popup object with a close() method on it.

This commit is contained in:
David Négrier 2021-03-09 18:51:30 +01:00
parent 18464e4942
commit bb8b222c22
5 changed files with 84 additions and 37 deletions

View file

@ -19,10 +19,8 @@ WA.onEnterZone('notExist', () => {
WA.sendChatMessage("YOU SHOULD NEVER SEE THIS", 'Poly Parrot');
})
let popupId;
WA.onEnterZone('popupZone', () => {
popupId = WA.openPopup('foobar', 'This is a test message. Hi!', [
WA.openPopup('foobar', 'This is a test message. Hi!', [
{
label: "Close",
className: "normal",
@ -31,8 +29,8 @@ WA.onEnterZone('popupZone', () => {
{
label: "Next",
className: "success",
callback: () => {
console.log('BUTTON CLICKED')
callback: (popup) => {
popup.close();
}
}
])