mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:32:25 -05:00
[frontend] scroll to highlighted toot, improve highlight (#885)
This commit is contained in:
parent
fe238f8595
commit
1a56352568
3 changed files with 12 additions and 4 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue