mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-26 05:36:38 +00:00
[frontend] scroll to highlighted toot, improve highlight (#885)
This commit is contained in:
parent
fe238f8595
commit
1a56352568
|
@ -71,7 +71,7 @@ $button-danger-fg: $gray1;
|
||||||
$button-danger-hover-bg: $orange2;
|
$button-danger-hover-bg: $orange2;
|
||||||
|
|
||||||
$toot-focus-bg: $gray5;
|
$toot-focus-bg: $gray5;
|
||||||
$toot-unfocus-bg: $gray3;
|
$toot-unfocus-bg: $gray2;
|
||||||
|
|
||||||
$toot-info-bg: $gray4;
|
$toot-info-bg: $gray4;
|
||||||
|
|
||||||
|
|
|
@ -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 PhotoswipeLightbox = require("photoswipe/dist/umd/photoswipe-lightbox.umd.min.js");
|
||||||
const PhotoswipeCaptionPlugin = require("photoswipe-dynamic-caption-plugin").default;
|
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({
|
const lightbox = new PhotoswipeLightbox({
|
||||||
gallery: '.photoswipe-gallery',
|
gallery: '.photoswipe-gallery',
|
||||||
children: 'a',
|
children: 'a',
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
<main>
|
<main>
|
||||||
<div data-nosnippet class="thread">
|
<div data-nosnippet class="thread">
|
||||||
{{range .context.Ancestors}}
|
{{range .context.Ancestors}}
|
||||||
<div class="toot">
|
<div class="toot" id="{{.ID}}">
|
||||||
{{ template "status.tmpl" .}}
|
{{ template "status.tmpl" .}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="toot expanded">
|
<div class="toot expanded" id="{{.status.ID}}">
|
||||||
{{ template "status.tmpl" .status}}
|
{{ template "status.tmpl" .status}}
|
||||||
</div>
|
</div>
|
||||||
{{range .context.Descendants}}
|
{{range .context.Descendants}}
|
||||||
<div class="toot">
|
<div class="toot" id="{{.ID}}">
|
||||||
{{ template "status.tmpl" .}}
|
{{ template "status.tmpl" .}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
Loading…
Reference in a new issue