From dab97293be4f509d6c9efd3cc76adac90f9abd37 Mon Sep 17 00:00:00 2001 From: MiepHD <63968466+MiepHD@users.noreply.github.com> Date: Fri, 11 Aug 2023 20:00:40 +0200 Subject: [PATCH] Fixes the video-toggle being displayed at the wrong position on fullscreen --- plugins/video-toggle/front.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/video-toggle/front.js b/plugins/video-toggle/front.js index 31c1b8f3..482df3c5 100644 --- a/plugins/video-toggle/front.js +++ b/plugins/video-toggle/front.js @@ -38,7 +38,7 @@ function setup(e) { player = $('ytmusic-player'); video = $('video'); - $('#main-panel').append(switchButtonDiv); + $('#player').prepend(switchButtonDiv); if (options.hideVideo) { $('.video-switch-button-checkbox').checked = false; @@ -48,6 +48,11 @@ function setup(e) { video.style.height = "auto"; } + //Prevents bubbling to the player which causes it to stop or resume + switchButtonDiv.addEventListener('click', (e) => { + e.stopPropagation(); + }); + // button checked = show video switchButtonDiv.addEventListener('change', (e) => { options.hideVideo = !e.target.checked;