mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 22:35:50 +01:00
fix(react/floating_buttons): backlinks affecting show/hide button
This commit is contained in:
@@ -100,6 +100,10 @@
|
|||||||
margin-left: 5px !important;
|
margin-left: 5px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.close-floating-buttons:first-child {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.close-floating-buttons-button {
|
.close-floating-buttons-button {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
color: var(--button-text-color);
|
color: var(--button-text-color);
|
||||||
@@ -156,4 +160,4 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: yellow;
|
background-color: yellow;
|
||||||
}
|
}
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ function InAppHelpButton({ note }: FloatingButtonContext) {
|
|||||||
|
|
||||||
function Backlinks({ note }: FloatingButtonContext) {
|
function Backlinks({ note }: FloatingButtonContext) {
|
||||||
let [ backlinkCount, setBacklinkCount ] = useState(0);
|
let [ backlinkCount, setBacklinkCount ] = useState(0);
|
||||||
let [ popupOpen, setPopupOpen ] = useState(true);
|
let [ popupOpen, setPopupOpen ] = useState(false);
|
||||||
const backlinksContainerRef = useRef<HTMLDivElement>(null);
|
const backlinksContainerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -351,22 +351,20 @@ function Backlinks({ note }: FloatingButtonContext) {
|
|||||||
}
|
}
|
||||||
}, [ popupOpen, windowHeight ]);
|
}, [ popupOpen, windowHeight ]);
|
||||||
|
|
||||||
return (
|
return (backlinkCount > 0 &&
|
||||||
<div className="backlinks-widget has-overflow">
|
<div className="backlinks-widget has-overflow">
|
||||||
{backlinkCount > 0 && <>
|
<div
|
||||||
<div
|
className="backlinks-ticker"
|
||||||
className="backlinks-ticker"
|
onClick={() => setPopupOpen(!popupOpen)}
|
||||||
onClick={() => setPopupOpen(!popupOpen)}
|
>
|
||||||
>
|
<span className="backlinks-count">{t("zpetne_odkazy.backlink", { count: backlinkCount })}</span>
|
||||||
<span className="backlinks-count">{t("zpetne_odkazy.backlink", { count: backlinkCount })}</span>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{popupOpen && (
|
{popupOpen && (
|
||||||
<div ref={backlinksContainerRef} className="backlinks-items dropdown-menu" style={{ display: "block" }}>
|
<div ref={backlinksContainerRef} className="backlinks-items dropdown-menu" style={{ display: "block" }}>
|
||||||
<BacklinksList noteId={note.noteId} />
|
<BacklinksList noteId={note.noteId} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user