mirror of
https://github.com/zadam/trilium.git
synced 2025-12-31 20:50:16 +01:00
Compare commits
1 Commits
fix/right-
...
fix/popupE
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a3f02e845 |
@@ -3,12 +3,9 @@ import clsx from "clsx";
|
||||
import { t } from "../../services/i18n";
|
||||
import ActionButton from "../react/ActionButton";
|
||||
import { useTriliumOptionBool } from "../react/hooks";
|
||||
import { useState } from "preact/hooks";
|
||||
import appContext from "../../components/app_context";
|
||||
|
||||
export default function RightPaneToggle() {
|
||||
const [rightPaneVisibleOption, setRightPaneVisibleOption] = useTriliumOptionBool("rightPaneVisible");
|
||||
const [rightPaneVisible, setRightPaneVisible] = useState(rightPaneVisibleOption);
|
||||
const [ rightPaneVisible, setRightPaneVisible ] = useTriliumOptionBool("rightPaneVisible");
|
||||
|
||||
return (
|
||||
<ActionButton
|
||||
@@ -18,11 +15,7 @@ export default function RightPaneToggle() {
|
||||
)}
|
||||
text={t("right_pane.toggle")}
|
||||
icon="bx bx-sidebar"
|
||||
onClick={() => {
|
||||
setRightPaneVisible(!rightPaneVisible);
|
||||
setRightPaneVisibleOption(!rightPaneVisible);
|
||||
appContext.triggerEvent("toggleRightPane", {});
|
||||
}}
|
||||
onClick={() => setRightPaneVisible(!rightPaneVisible)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ export default function PopupEditor() {
|
||||
onHidden={() => setShown(false)}
|
||||
keepInDom // needed for faster loading
|
||||
noFocus // automatic focus breaks block popup
|
||||
stackable
|
||||
>
|
||||
{!isNewLayout && <ReadOnlyNoteInfoBar />}
|
||||
<PromotedAttributes />
|
||||
|
||||
@@ -3,7 +3,7 @@ import "./RightPanelContainer.css";
|
||||
|
||||
import Split from "@triliumnext/split.js";
|
||||
import { VNode } from "preact";
|
||||
import { useState, useEffect, useRef } from "preact/hooks";
|
||||
import { useEffect, useRef } from "preact/hooks";
|
||||
|
||||
import appContext from "../../components/app_context";
|
||||
import { WidgetsByParent } from "../../services/bundle";
|
||||
@@ -27,12 +27,10 @@ interface RightPanelWidgetDefinition {
|
||||
}
|
||||
|
||||
export default function RightPanelContainer({ widgetsByParent }: { widgetsByParent: WidgetsByParent }) {
|
||||
const [rightPaneVisibleOption, setRightPaneVisibleOption] = useTriliumOptionBool("rightPaneVisible");
|
||||
const [rightPaneVisible, setRightPaneVisible] = useState(rightPaneVisibleOption);
|
||||
const [ rightPaneVisible, setRightPaneVisible ] = useTriliumOptionBool("rightPaneVisible");
|
||||
const items = useItems(rightPaneVisible, widgetsByParent);
|
||||
useSplit(rightPaneVisible);
|
||||
useTriliumEvent("toggleRightPane", () => {
|
||||
setRightPaneVisibleOption(!rightPaneVisible);
|
||||
setRightPaneVisible(!rightPaneVisible);
|
||||
});
|
||||
|
||||
@@ -47,10 +45,7 @@ export default function RightPanelContainer({ widgetsByParent }: { widgetsByPare
|
||||
{t("right_pane.empty_message")}
|
||||
<Button
|
||||
text={t("right_pane.empty_button")}
|
||||
onClick={() => {
|
||||
setRightPaneVisibleOption(!rightPaneVisible);
|
||||
setRightPaneVisible(!rightPaneVisible);
|
||||
}}
|
||||
onClick={() => setRightPaneVisible(!rightPaneVisible)}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user