Scroll up on page change

This commit is contained in:
Thomas Forgione 2020-10-06 18:32:10 +02:00
parent 707d4f45f1
commit f22e1c576b
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,7 @@
if (app.ports !== undefined && app.ports.registerVideo !== undefined) { if (app.ports !== undefined && app.ports.registerVideo !== undefined) {
app.ports.registerVideo.subscribe(function(args) { app.ports.registerVideo.subscribe(function(args) {
window.scrollTo(0, 0);
var time = parseInt(args[2], 10) || undefined; var time = parseInt(args[2], 10) || undefined;
requestAnimationFrame(function() { requestAnimationFrame(function() {
@ -41,6 +42,7 @@
if (app.ports !== undefined && app.ports.eraseVideo !== undefined) { if (app.ports !== undefined && app.ports.eraseVideo !== undefined) {
app.ports.eraseVideo.subscribe(function() { app.ports.eraseVideo.subscribe(function() {
window.scrollTo(0, 0);
lastId = undefined; lastId = undefined;
}); });
} }