diff options
author | 2022-10-03 20:35:43 +0200 | |
---|---|---|
committer | 2022-10-03 20:35:43 +0200 | |
commit | 1a56352568c64e2b91c52b52579d3e7f53b7015c (patch) | |
tree | cf8ceee4e8eb8e9e1938122f83d9353feca09e92 /web/source/frontend/index.js | |
parent | [frontend] change spacing of status, text always on it's own line, move statu... (diff) | |
download | gotosocial-1a56352568c64e2b91c52b52579d3e7f53b7015c.tar.xz |
[frontend] scroll to highlighted toot, improve highlight (#885)
Diffstat (limited to 'web/source/frontend/index.js')
-rw-r--r-- | web/source/frontend/index.js | 8 |
1 files changed, 8 insertions, 0 deletions
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', |