Skip to content

Commit

Permalink
new option code-charity#1563
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedLebda committed Mar 15, 2023
1 parent 354c4f9 commit 4f79d56
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content-scripts/website-context/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
15 changes: 15 additions & 0 deletions content-scripts/website-context/youtube-features/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------------------------------------------------------------*/
Expand Down
4 changes: 4 additions & 0 deletions options-page/skeleton-parts/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
},
};
Expand Down

0 comments on commit 4f79d56

Please sign in to comment.