mirror of
https://github.com/zadam/trilium.git
synced 2025-12-20 22:34:23 +01:00
feat(layout): keyboard shortcut for note paths
This commit is contained in:
parent
4f1c19f1e2
commit
998a16ab87
@ -1,6 +1,6 @@
|
||||
import "./StatusBar.css";
|
||||
|
||||
import { Locale } from "@triliumnext/commons";
|
||||
import { KeyboardActionNames, Locale } from "@triliumnext/commons";
|
||||
import { Dropdown as BootstrapDropdown } from "bootstrap";
|
||||
import clsx from "clsx";
|
||||
import { type ComponentChildren } from "preact";
|
||||
@ -381,12 +381,18 @@ function AttributesPane({ note, noteContext, attributesShown, setAttributesShown
|
||||
|
||||
//#region Note paths
|
||||
function NotePaths({ note, hoistedNoteId, notePath }: StatusBarContext) {
|
||||
const dropdownRef = useRef<BootstrapDropdown>(null);
|
||||
const sortedNotePaths = useSortedNotePaths(note, hoistedNoteId);
|
||||
const count = sortedNotePaths?.length ?? 0;
|
||||
const enabled = count > 1;
|
||||
|
||||
return (count > 1 &&
|
||||
// Keyboard shortcut.
|
||||
useTriliumEvent("toggleRibbonTabNotePaths", () => enabled && dropdownRef.current?.show());
|
||||
|
||||
return (enabled &&
|
||||
<StatusBarDropdown
|
||||
title={t("status_bar.note_paths_title")}
|
||||
dropdownRef={dropdownRef}
|
||||
dropdownContainerClassName="dropdown-note-paths"
|
||||
icon="bx bx-directions"
|
||||
text={t("status_bar.note_paths", { count })}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user