[Posts] Prevent the wiki excerpt from briefly being on the screen when hidden (#899)

This commit is contained in:
Cinder 2025-02-06 22:32:54 -08:00 committed by GitHub
parent a7a2d37a6b
commit 11cc763ee4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 11 deletions

View File

@ -30,16 +30,9 @@ PostSearch.initialize_input = function ($form) {
PostSearch.initialize_wiki_preview = function ($preview) {
let visible = LStorage.Posts.WikiExcerpt;
switch (visible) {
case 1: {
$preview.addClass("open");
break;
}
case 2: {
$preview.addClass("hidden");
break;
}
}
if (visible == 2) return; // hidden
if (visible == 1) $preview.addClass("open");
$preview.removeClass("hidden");
window.setTimeout(() => { // Disable the rollout on first load
$preview.removeClass("loading");

View File

@ -1,6 +1,6 @@
<div id="posts" class="post-index-gallery user-disable-cropped-<%= Danbooru.config.enable_image_cropping? && CurrentUser.user.disable_cropped_thumbnails? %>">
<% if @wiki_text.present? %>
<section class="wiki-excerpt loading">
<section class="wiki-excerpt loading hidden">
<h3 role="button" class="wiki-excerpt-toggle">
<%= svg_icon(:chevron_right) %>
<span><%= @wiki_page.pretty_title %></span>