From 7f15b0c00797fb354487143435ca490475967d5b Mon Sep 17 00:00:00 2001 From: Splines Date: Tue, 27 Feb 2024 00:26:04 +0100 Subject: [PATCH] Fix wrong resizing when exiting full screen mode --- .../javascripts/thyme/components/full_screen_button.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/thyme/components/full_screen_button.js b/app/assets/javascripts/thyme/components/full_screen_button.js index 19c0f87d6..d8991456d 100644 --- a/app/assets/javascripts/thyme/components/full_screen_button.js +++ b/app/assets/javascripts/thyme/components/full_screen_button.js @@ -52,6 +52,7 @@ class FullScreenButton extends Component { #fullscreenChange() { if (document.fullscreenElement) { + // User enters fullscreen mode this.element.innerHTML = "fullscreen_exit"; this.element.dataset.status = "true"; /* Set height to 100vh in fullscreen mode as it otherwise @@ -59,14 +60,10 @@ class FullScreenButton extends Component { $(thymeAttributes.video).css("height", "100vh"); } else { + // User exists fullscreen mode this.element.innerHTML = "fullscreen"; this.element.dataset.status = "false"; $(thymeAttributes.video).css("height", "100%"); - /* brute force patch: apparently, after exiting fullscreen mode, - window.onresize is triggered twice(!), the second time with incorrect - window height data, which results in a video area not quite filling - the whole window. The next line resizes the container again. */ - setTimeout(Resizer.resizeContainer($(this.container), 1, 0), 20); } } }