From 1a56352568c64e2b91c52b52579d3e7f53b7015c Mon Sep 17 00:00:00 2001 From: f0x52 Date: Mon, 3 Oct 2022 20:35:43 +0200 Subject: [frontend] scroll to highlighted toot, improve highlight (#885) --- web/source/frontend/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'web/source/frontend/index.js') diff --git a/web/source/frontend/index.js b/web/source/frontend/index.js index 2a54d52b6..b1187f515 100644 --- a/web/source/frontend/index.js +++ b/web/source/frontend/index.js @@ -22,6 +22,14 @@ const Photoswipe = require("photoswipe/dist/umd/photoswipe.umd.min.js"); const PhotoswipeLightbox = require("photoswipe/dist/umd/photoswipe-lightbox.umd.min.js"); const PhotoswipeCaptionPlugin = require("photoswipe-dynamic-caption-plugin").default; +let [_, _user, type, id] = window.location.pathname.split("/"); +if (type == "statuses") { + let firstStatus = document.getElementsByClassName("thread")[0].children[0]; + if (firstStatus.id != id) { + document.getElementById(id).scrollIntoView(); + } +} + const lightbox = new PhotoswipeLightbox({ gallery: '.photoswipe-gallery', children: 'a', -- cgit v1.2.3