mirror of
https://github.com/zadam/trilium.git
synced 2025-12-12 02:14:25 +01:00
fix(client/floating_buttons): clipped by floating content header
This commit is contained in:
parent
d5d2815bdf
commit
5770222304
@ -6,11 +6,12 @@
|
||||
.floating-buttons-children,
|
||||
.show-floating-buttons {
|
||||
position: absolute;
|
||||
top: calc(var(--floating-buttons-vert-offset, 14px) + var(--ribbon-height, 0));
|
||||
top: calc(var(--floating-buttons-vert-offset, 14px) + var(--ribbon-height, 0px) + var(--content-header-height, 0px));
|
||||
inset-inline-end: var(--floating-buttons-horiz-offset, 10px);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
z-index: 100;
|
||||
transition: top 0.3s ease;
|
||||
}
|
||||
|
||||
.note-split.rtl .floating-buttons-children,
|
||||
|
||||
@ -59,14 +59,13 @@ export default class ContentHeader extends Container<BasicWidget> {
|
||||
if (shouldFloat !== this.isFloating) {
|
||||
this.isFloating = shouldFloat;
|
||||
|
||||
const parentEl = this.parentElement?.closest<HTMLDivElement>(".note-split");
|
||||
if (shouldFloat) {
|
||||
this.$widget.addClass("floating");
|
||||
// Set CSS variable so ribbon can position itself below the floating header
|
||||
this.parentElement!.style.setProperty("--content-header-height", `${this.currentHeight}px`);
|
||||
parentEl!.style.setProperty("--content-header-height", `${this.currentHeight}px`);
|
||||
} else {
|
||||
this.$widget.removeClass("floating");
|
||||
// Reset CSS variable when header is not floating
|
||||
this.parentElement!.style.removeProperty("--content-header-height");
|
||||
parentEl!.style.removeProperty("--content-header-height");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user