From 624f053d02fdaccbc73ecfacf25a9343fd13f6c4 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Wed, 3 Apr 2024 11:43:36 +0200 Subject: [PATCH] Fix autofocus. --- conversejs/builtin.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/conversejs/builtin.ts b/conversejs/builtin.ts index 6797500b..dd58f2fd 100644 --- a/conversejs/builtin.ts +++ b/conversejs/builtin.ts @@ -85,10 +85,14 @@ async function initConverse ( const isInIframe = inIframe() initDom(initConverseParams, isInIframe) - if (!isInIframe) { initConverseParams.autofocus = true } - if (isInIframe || chatIncludeMode === 'peertube-video') { - initConverseParams.forceDefaultHideMucParticipants = true - } + + // Autofocus: false if besides video, or if an external iframe + initConverseParams.autofocus = (chatIncludeMode === 'peertube-fullpage') || + (chatIncludeMode === 'chat-only' && !isInIframe) + + // hide participant if in an external iframe, or besides video. + initConverseParams.forceDefaultHideMucParticipants = (isInIframe || chatIncludeMode === 'peertube-video') + const params = defaultConverseParams(initConverseParams) params.view_mode = chatIncludeMode === 'chat-only' ? 'fullscreen' : 'embedded' params.allow_url_history_change = chatIncludeMode === 'chat-only'