From ae90b41aaec3087f0fa30044217d388d407cfb2f Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 28 Jan 2023 22:34:36 +0800 Subject: [PATCH] New feature: "Show all sensitive content" menu --- src/app.css | 3 +++ src/components/status.jsx | 4 ++-- src/index.css | 7 +++++++ src/pages/status.jsx | 29 +++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/app.css b/src/app.css index 08b3f00f..fa785a5c 100644 --- a/src/app.css +++ b/src/app.css @@ -818,6 +818,9 @@ button.carousel-dot:is(.active, [disabled].active) { .szh-menu .szh-menu__item { padding: 8px 16px !important; } +.szh-menu .szh-menu__item * { + vertical-align: middle; +} .szh-menu .szh-menu__item:not(.szh-menu__item--disabled, .szh-menu__item--hover) { color: var(--text-color); diff --git a/src/components/status.jsx b/src/components/status.jsx index a9186df1..9d72587a 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -325,7 +325,7 @@ function Status({

{spoilerText}

+ } + > + { + // Click all buttons with class .spoiler but not .spoiling + const buttons = Array.from( + scrollableRef.current.querySelectorAll( + 'button.spoiler:not(.spoiling)', + ), + ); + buttons.forEach((button) => { + button.click(); + }); + }} + > + Show all sensitive content + +