mirror of
https://github.com/zadam/trilium.git
synced 2025-12-24 00:04:23 +01:00
feat(layout): keyboard shortcut for promoted attributes
This commit is contained in:
parent
22e0776049
commit
77b92385cb
@ -1,7 +1,7 @@
|
|||||||
import "./NoteTitleActions.css";
|
import "./NoteTitleActions.css";
|
||||||
|
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { useEffect, useState } from "preact/hooks";
|
import { useEffect, useRef, useState } from "preact/hooks";
|
||||||
|
|
||||||
import NoteContext from "../../components/note_context";
|
import NoteContext from "../../components/note_context";
|
||||||
import FNote from "../../entities/fnote";
|
import FNote from "../../entities/fnote";
|
||||||
@ -10,7 +10,7 @@ import CollectionProperties from "../note_bars/CollectionProperties";
|
|||||||
import { checkFullHeight, getExtendedWidgetType } from "../NoteDetail";
|
import { checkFullHeight, getExtendedWidgetType } from "../NoteDetail";
|
||||||
import { PromotedAttributesContent, usePromotedAttributeData } from "../PromotedAttributes";
|
import { PromotedAttributesContent, usePromotedAttributeData } from "../PromotedAttributes";
|
||||||
import Collapsible, { ExternallyControlledCollapsible } from "../react/Collapsible";
|
import Collapsible, { ExternallyControlledCollapsible } from "../react/Collapsible";
|
||||||
import { useNoteContext, useNoteProperty } from "../react/hooks";
|
import { useNoteContext, useNoteProperty, useTriliumEvent } from "../react/hooks";
|
||||||
import SearchDefinitionTab from "../ribbon/SearchDefinitionTab";
|
import SearchDefinitionTab from "../ribbon/SearchDefinitionTab";
|
||||||
|
|
||||||
export default function NoteTitleActions() {
|
export default function NoteTitleActions() {
|
||||||
@ -57,6 +57,9 @@ function PromotedAttributes({ note, componentId, noteContext }: {
|
|||||||
});
|
});
|
||||||
}, [ note, noteContext ]);
|
}, [ note, noteContext ]);
|
||||||
|
|
||||||
|
// Keyboard shortcut.
|
||||||
|
useTriliumEvent("toggleRibbonTabPromotedAttributes", () => setExpanded(!expanded));
|
||||||
|
|
||||||
if (!cells?.length) return false;
|
if (!cells?.length) return false;
|
||||||
return (note && (
|
return (note && (
|
||||||
<ExternallyControlledCollapsible
|
<ExternallyControlledCollapsible
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user