From 67f2ce434dc8f23d17afc99e87503361f5c39d61 Mon Sep 17 00:00:00 2001 From: aumouvantsillage Date: Sun, 17 Nov 2024 21:32:59 +0100 Subject: [PATCH] Fixes #633 - Force the with of the notes pane when preview pane is resized --- locales/messages.pot | 2 +- src/js/presenter.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/locales/messages.pot b/locales/messages.pot index 928574ea..3ac5adcd 100644 --- a/locales/messages.pot +++ b/locales/messages.pot @@ -1,6 +1,6 @@ msgid "" msgstr "" -"POT-Creation-Date: 2024-11-13 08:02:+0000\n" +"POT-Creation-Date: 2024-11-17 08:29:+0000\n" "Project-Id-Version: PACKAGE VERSION\n" "Language-Team: LANGUAGE \n" "Language: \n" diff --git a/src/js/presenter.js b/src/js/presenter.js index 5f481f26..d727b5b3 100644 --- a/src/js/presenter.js +++ b/src/js/presenter.js @@ -63,6 +63,13 @@ window.addEventListener("load", () => { p.window = iframes[i].contentWindow; }); + // Prevent the notes pane to change size when its content is updated. + const preview = document.querySelector(".sozi-frame-preview"); + const notes = document.querySelector(".sozi-notes"); + new ResizeObserver(() => { + notes.style.width = `calc(100vw - ${preview.offsetWidth}px`; + }).observe(preview); + // Open a new window for the main presentation view. presWindow = window.open(iframes[0].src, "sozi-presentation", "width=600, height=400, scrollbars=yes, toolbar=yes"); try {