diff --git a/content-scripts/website-context/init.js b/content-scripts/website-context/init.js index 65aa0e613..7c0e994e9 100644 --- a/content-scripts/website-context/init.js +++ b/content-scripts/website-context/init.js @@ -69,7 +69,8 @@ ImprovedTube.init = function () { document.addEventListener('yt-navigate-finish', function () { ImprovedTube.pageType(); - + ImprovedTube.commentsSidebarPosition(); + if (ImprovedTube.elements.player && ImprovedTube.elements.player.setPlaybackRate) { ImprovedTube.videoPageUpdate(); ImprovedTube.initPlayer(); diff --git a/content-scripts/website-context/youtube-features/appearance.js b/content-scripts/website-context/youtube-features/appearance.js index 2f956cbb8..47476b116 100644 --- a/content-scripts/website-context/youtube-features/appearance.js +++ b/content-scripts/website-context/youtube-features/appearance.js @@ -149,6 +149,21 @@ ImprovedTube.playerRemainingDuration = function () { } }; +/*------------------------------------------------------------------------------ +4.2.1.6 Comments position to sidebar +------------------------------------------------------------------------------*/ +ImprovedTube.commentsSidebarPosition=()=>{ + console.log("from new function") + if(ImprovedTube.storage.comments_sidebar_position){ + document.querySelector("#columns").appendChild(document.querySelector("#comments"),function() { + console.log("comments and its children have been appended to columns")}) + document.querySelector("#primary-inner").appendChild(document.querySelector("#secondary"),function() { + console.log("secondary and its children have been appended to primary-inner")}) + }else{ + document.querySelector("#columns").appendChild(document.querySelector("#secondary")) + document.querySelector("#below").appendChild(document.querySelector("#comments")) + } +} /*------------------------------------------------------------------------------ 4.2.2 SIDEBAR ------------------------------------------------------------------------------*/ diff --git a/options-page/skeleton-parts/appearance.js b/options-page/skeleton-parts/appearance.js index 41e7fb27b..d9fbb0604 100644 --- a/options-page/skeleton-parts/appearance.js +++ b/options-page/skeleton-parts/appearance.js @@ -425,6 +425,10 @@ extension.skeleton.main.layers.section.appearance.on.click.player = { text: "hideScrollForDetails", tags: "remove,hide", }, + comments_sidebar_position: { + component: "switch", + text: "commentsSidebarPosition", + }, }, }, };