From edd4e9e95d7fcf223c43fe616fb53fca33a304e5 Mon Sep 17 00:00:00 2001 From: PizZaKatZe Date: Tue, 9 Mar 2021 20:01:48 +0100 Subject: [PATCH] Add touch support for Jitsi and website triggers --- front/src/Phaser/Game/GameScene.ts | 4 ++-- front/src/WebRtc/LayoutManager.ts | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index a9ba86a6..24511582 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -668,7 +668,7 @@ export class GameScene extends ResizableScene implements CenterListener { if(openWebsiteTriggerValue && openWebsiteTriggerValue === ON_ACTION_TRIGGER_BUTTON) { let message = allProps.get(WEBSITE_MESSAGE_PROPERTIES); if(message === undefined){ - message = 'Press on SPACE to open the web site'; + message = 'Press SPACE or touch here to open web site'; } layoutManager.addActionButton('openWebsite', message.toString(), () => { openWebsiteFunction(); @@ -700,7 +700,7 @@ export class GameScene extends ResizableScene implements CenterListener { if(jitsiTriggerValue && jitsiTriggerValue === ON_ACTION_TRIGGER_BUTTON) { let message = allProps.get(JITSI_MESSAGE_PROPERTIES); if (message === undefined) { - message = 'Press on SPACE to enter in jitsi meet room'; + message = 'Press SPACE or touch here to enter Jitsi Meet room'; } layoutManager.addActionButton('jitsiRoom', message.toString(), () => { openJitsiRoomFunction(); diff --git a/front/src/WebRtc/LayoutManager.ts b/front/src/WebRtc/LayoutManager.ts index 233b5327..a0b805d4 100644 --- a/front/src/WebRtc/LayoutManager.ts +++ b/front/src/WebRtc/LayoutManager.ts @@ -340,14 +340,10 @@ class LayoutManager { const mainContainer = HtmlUtils.getElementByIdOrFail('main-container'); mainContainer.appendChild(div); - const callBackFunctionTrigger = (() => { - console.log('user click on space => ', id); - callBack(); - }); - //add trigger action - this.actionButtonTrigger.set(id, callBackFunctionTrigger); - userInputManager.addSpaceEventListner(callBackFunctionTrigger); + div.onpointerdown = () => callBack(); + this.actionButtonTrigger.set(id, callBack); + userInputManager.addSpaceEventListner(callBack); } public removeActionButton(id: string, userInputManager: UserInputManager){