Skip to content

Commit 6b0a8ce

Browse files
committed
Fix scroll listeners to load thumbnails
1 parent 88a2bfe commit 6b0a8ce

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

dist/ytbsp.meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name YouTube Better Start Page (YTBSP)
33
// @description Spotlights all subscriptions in an organized fashion on the start page of YouTube.
4-
// @version 3.0.15
4+
// @version 3.0.16
55
// @author Crow08, dzre, Nemo64
66
// @namespace ytbsp
77
// @include https://youtube.com/*

dist/ytbsp.user.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ytbsp",
3-
"version": "3.0.15",
3+
"version": "3.0.16",
44
"description": "Spotlights all your subscriptions in an organized fashion on the start page of YouTube.",
55
"scripts": {
66
"lint": "eslint --format unix src/",

src/Components/SubListComponent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default class SubListComponent extends Component {
5555
ytsub().then((subs) => this.initSubs(subs)).catch((err) => console.error(err));
5656

5757
dataService.addReorderListener((subs) => this.updateSubOrder(subs));
58+
pageService.addViewChangeListeners(this.component);
5859
}
5960

6061
removeAllVideos(): void {

src/Services/PageService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,6 @@ class PageService {
193193
this.onDocumentReadyCallbackList = [];
194194
this.installDummyPopup();
195195
});
196-
197-
window.addEventListener("scroll", throttleTime(() => this.handleViewChange()), false);
198-
window.addEventListener("resize", throttleTime(() => this.handleViewChange()), false);
199196
}
200197

201198
/**
@@ -419,6 +416,11 @@ class PageService {
419416
callback();
420417
});
421418
};
419+
420+
addViewChangeListeners(component: JQuery) {
421+
component.on( "scroll", throttleTime(() => this.handleViewChange()));
422+
window.addEventListener("resize", throttleTime(() => this.handleViewChange()), false);
423+
}
422424
}
423425

424426
const pageService = new PageService();

0 commit comments

Comments
 (0)