JS-Datei mit Popup
This commit is contained in:
parent
ec9d37249c
commit
f4633d1429
1 changed files with 17 additions and 3 deletions
20
malen.js
20
malen.js
|
@ -1,4 +1,18 @@
|
|||
WA.onEnterZone('malen-1', () => {
|
||||
WA.sendChatMessage("Hello!", 'Mr Robot');
|
||||
})
|
||||
let helloWorldPopup;
|
||||
|
||||
// Open the popup when we enter a given zone
|
||||
helloWorldPopup = WA.onEnterZone('malen-1', () => {
|
||||
WA.openPopup("popupRectangle", 'Hello world!', [{
|
||||
label: "Close",
|
||||
className: "primary",
|
||||
callback: (popup) => {
|
||||
// Close the popup when the "Close" button is pressed.
|
||||
popup.close();
|
||||
}
|
||||
});
|
||||
}]);
|
||||
|
||||
// Close the popup when we leave the zone.
|
||||
WA.onLeaveZone('malen-1', () => {
|
||||
helloWorldPopup.close();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue