mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 14:55: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);
|
||||||
|
|||||||
@@ -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,9 +351,8 @@ 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)}
|
||||||
@@ -366,7 +365,6 @@ function Backlinks({ note }: FloatingButtonContext) {
|
|||||||
<BacklinksList noteId={note.noteId} />
|
<BacklinksList noteId={note.noteId} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user