mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 18:45:52 -06:00
fix(content_header): note icon dropdown broken when scrolling
This commit is contained in:
parent
5d59c953c2
commit
cb31c25e6c
@ -1,6 +1,6 @@
|
|||||||
.content-header-widget {
|
.content-header-widget {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 8;
|
z-index: 998;
|
||||||
background-color: var(--main-background-color);
|
background-color: var(--main-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -45,9 +45,12 @@ export default class ContentHeader extends Container<BasicWidget> {
|
|||||||
updateScrollState() {
|
updateScrollState() {
|
||||||
const currentScrollTop = this.parentElement!.scrollTop;
|
const currentScrollTop = this.parentElement!.scrollTop;
|
||||||
const isScrollingUp = currentScrollTop < this.previousScrollTop;
|
const isScrollingUp = currentScrollTop < this.previousScrollTop;
|
||||||
|
const hasDropdownOpen = this.thisElement!.querySelector(".dropdown-menu.show") !== null;
|
||||||
const hasMovedEnough = Math.abs(currentScrollTop - this.previousScrollTop) > this.scrollThreshold;
|
const hasMovedEnough = Math.abs(currentScrollTop - this.previousScrollTop) > this.scrollThreshold;
|
||||||
|
|
||||||
if (currentScrollTop === 0) {
|
if (hasDropdownOpen) {
|
||||||
|
this.setFloating(true);
|
||||||
|
} else if (currentScrollTop === 0) {
|
||||||
this.setFloating(false);
|
this.setFloating(false);
|
||||||
} else if (hasMovedEnough) {
|
} else if (hasMovedEnough) {
|
||||||
this.setFloating(isScrollingUp);
|
this.setFloating(isScrollingUp);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user