Skip to content
This repository was archived by the owner on Jul 29, 2023. It is now read-only.

Commit 30bd790

Browse files
author
Alex Sørlie Glomsaas
committed
Scale the size of the comment section to confirm to recent YouTube changes
1 parent cd7d3ce commit 30bd790

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

lib/script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,13 @@ var AlienTube = {
257257
output += '<div id=\"redditTabs\">' + Mustache.render(AlienTube.Template, {tab: true, active: true, subreddit: results[0].subreddit});
258258
// Calculate the number of tabs we can display by adding the width of the chrome (43px) with the average width of a text character times subreddit length.
259259
var width = (21 + results[0].subreddit.length * 7);
260+
var maxWidth = document.getElementById("watch7-content").offsetWidth - 80;
260261
var len = results.length;
261262
if (len > 1) {
262263
var i;
263264
for (i = 1; i < len; i++) {
264265
width = width + (21 + (results[i].subreddit.length * 7));
265-
if (width >= 550) {
266+
if (width >= maxWidth) {
266267
break;
267268
}
268269
// Get the HTML for the tabs.

res/style.css

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ article span .downvotes {
7777
#reddit {
7878
margin-top: 40px;
7979
padding-bottom: 40px;
80-
width: 628px;
80+
width: 95%;
8181
padding-right: 20px;
8282
box-sizing: border-box;
8383
}
@@ -260,10 +260,6 @@ article a:hover {
260260
transition: opacity 1s ease-in;
261261
}
262262

263-
#watch7-sidebar {
264-
margin-left: 655px !important;
265-
}
266-
267263
#redditOverflow ul li {
268264
line-height: 1.8;
269265
padding-left: 10px;
@@ -538,7 +534,7 @@ header .vote {
538534

539535
@-webkit-keyframes duckinvasion {
540536
0% { left: -100px; }
541-
100% { left: 100%; }
537+
100% { left: 100%; }
542538
}
543539
@-moz-keyframes duckinvasion {
544540
0% { left: -100px; }
@@ -550,7 +546,7 @@ header .vote {
550546
}
551547
@keyframes duckinvasion {
552548
0% { left: -100px; }
553-
100% { left: 100%; }
549+
100% { left: 100%; }
554550
}
555551

556552
.redditSpinner {

0 commit comments

Comments
 (0)