forked from e621ng/e621ng
[Posts] Prevent the wiki excerpt from briefly being on the screen when hidden (#899)
This commit is contained in:
parent
a7a2d37a6b
commit
11cc763ee4
@ -30,16 +30,9 @@ PostSearch.initialize_input = function ($form) {
|
|||||||
|
|
||||||
PostSearch.initialize_wiki_preview = function ($preview) {
|
PostSearch.initialize_wiki_preview = function ($preview) {
|
||||||
let visible = LStorage.Posts.WikiExcerpt;
|
let visible = LStorage.Posts.WikiExcerpt;
|
||||||
switch (visible) {
|
if (visible == 2) return; // hidden
|
||||||
case 1: {
|
if (visible == 1) $preview.addClass("open");
|
||||||
$preview.addClass("open");
|
$preview.removeClass("hidden");
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2: {
|
|
||||||
$preview.addClass("hidden");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.setTimeout(() => { // Disable the rollout on first load
|
window.setTimeout(() => { // Disable the rollout on first load
|
||||||
$preview.removeClass("loading");
|
$preview.removeClass("loading");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div id="posts" class="post-index-gallery user-disable-cropped-<%= Danbooru.config.enable_image_cropping? && CurrentUser.user.disable_cropped_thumbnails? %>">
|
<div id="posts" class="post-index-gallery user-disable-cropped-<%= Danbooru.config.enable_image_cropping? && CurrentUser.user.disable_cropped_thumbnails? %>">
|
||||||
<% if @wiki_text.present? %>
|
<% if @wiki_text.present? %>
|
||||||
<section class="wiki-excerpt loading">
|
<section class="wiki-excerpt loading hidden">
|
||||||
<h3 role="button" class="wiki-excerpt-toggle">
|
<h3 role="button" class="wiki-excerpt-toggle">
|
||||||
<%= svg_icon(:chevron_right) %>
|
<%= svg_icon(:chevron_right) %>
|
||||||
<span><%= @wiki_page.pretty_title %></span>
|
<span><%= @wiki_page.pretty_title %></span>
|
||||||
|
Loading…
Reference in New Issue
Block a user