mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
refactor(next): remove use of :has for performance reasons
This commit is contained in:
parent
2fac2a8c5e
commit
24340d3a8e
@ -71,13 +71,13 @@ body.background-effects.platform-win32.layout-vertical #vertical-main-container
|
|||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|
||||||
/* Matches when the left pane is collapsed */
|
/* Matches when the left pane is collapsed */
|
||||||
#horizontal-main-container:has(#left-pane.hidden-int) {
|
#horizontal-main-container.left-pane-hidden {
|
||||||
--center-pane-border-radius: 0;
|
--center-pane-border-radius: 0;
|
||||||
--tab-first-item-horiz-offset: 5px;
|
--tab-first-item-horiz-offset: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add a border to the vertical launch bar if collapsed. */
|
/* Add a border to the vertical launch bar if collapsed. */
|
||||||
body.layout-vertical #horizontal-main-container:has(#left-pane.hidden-int) #launcher-pane.vertical {
|
body.layout-vertical #horizontal-main-container.left-pane-hidden #launcher-pane.vertical {
|
||||||
border-right: 2px solid var(--left-pane-collapsed-border-color);
|
border-right: 2px solid var(--left-pane-collapsed-border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import type Component from "../../components/component.js";
|
|||||||
|
|
||||||
export default class LeftPaneContainer extends FlexContainer<Component> {
|
export default class LeftPaneContainer extends FlexContainer<Component> {
|
||||||
private currentLeftPaneVisible: boolean;
|
private currentLeftPaneVisible: boolean;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super("column");
|
super("column");
|
||||||
|
|
||||||
@ -24,6 +24,7 @@ export default class LeftPaneContainer extends FlexContainer<Component> {
|
|||||||
this.currentLeftPaneVisible = leftPaneVisible ?? !this.currentLeftPaneVisible;
|
this.currentLeftPaneVisible = leftPaneVisible ?? !this.currentLeftPaneVisible;
|
||||||
const visible = this.isEnabled();
|
const visible = this.isEnabled();
|
||||||
this.toggleInt(visible);
|
this.toggleInt(visible);
|
||||||
|
this.parent?.$widget.toggleClass("left-pane-hidden", !visible);
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
this.triggerEvent("focusTree", {});
|
this.triggerEvent("focusTree", {});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user