From 7fddcc28f1f51aa7f841aac30702c820fea8d587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Tue, 9 Mar 2021 18:57:25 +0100 Subject: [PATCH] Removing closeOnClick as it is not implemented --- front/src/Api/Events/OpenPopupEvent.ts | 3 +-- front/src/iframe_api.ts | 9 ++------- maps/tests/script.js | 4 +++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/front/src/Api/Events/OpenPopupEvent.ts b/front/src/Api/Events/OpenPopupEvent.ts index 55df8a40..094ba555 100644 --- a/front/src/Api/Events/OpenPopupEvent.ts +++ b/front/src/Api/Events/OpenPopupEvent.ts @@ -3,8 +3,7 @@ import * as tg from "generic-type-guard"; const isButtonDescriptor = new tg.IsInterface().withProperties({ label: tg.isString, - className: tg.isOptional(tg.isString), - closeOnClick: tg.isOptional(tg.isBoolean) + className: tg.isOptional(tg.isString) }).get(); export const isOpenPopupEvent = diff --git a/front/src/iframe_api.ts b/front/src/iframe_api.ts index 44a7f0ea..b8bbecfe 100644 --- a/front/src/iframe_api.ts +++ b/front/src/iframe_api.ts @@ -42,11 +42,7 @@ interface ButtonDescriptor { /** * Callback called if the button is pressed */ - callback?: ButtonClickedCallback, - /** - * If set to true, the popup is closed when the button is clicked - */ - closeOnClick?: boolean + callback: ButtonClickedCallback, } class Popup { @@ -109,8 +105,7 @@ window.WA = { buttons: buttons.map((button) => { return { label: button.label, - className: button.className, - closeOnClick: button.closeOnClick + className: button.className }; }) } as OpenPopupEvent diff --git a/maps/tests/script.js b/maps/tests/script.js index 072f3f63..662f93f8 100644 --- a/maps/tests/script.js +++ b/maps/tests/script.js @@ -24,7 +24,9 @@ WA.onEnterZone('popupZone', () => { { label: "Close", className: "normal", - closeOnClick: true + callback: (popup) => { + popup.close(); + } }, { label: "Next",