mirror of
https://github.com/zadam/trilium.git
synced 2025-12-15 12:49:53 +01:00
fix(status_bar): attributes not editable from modal
This commit is contained in:
@@ -4,7 +4,7 @@ import { Locale } from "@triliumnext/commons";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { type ComponentChildren } from "preact";
|
import { type ComponentChildren } from "preact";
|
||||||
import { createPortal } from "preact/compat";
|
import { createPortal } from "preact/compat";
|
||||||
import { useContext, useRef, useState } from "preact/hooks";
|
import { useContext, useMemo, useRef, useState } from "preact/hooks";
|
||||||
|
|
||||||
import { CommandNames } from "../../components/app_context";
|
import { CommandNames } from "../../components/app_context";
|
||||||
import NoteContext from "../../components/note_context";
|
import NoteContext from "../../components/note_context";
|
||||||
@@ -17,7 +17,7 @@ import { formatDateTime } from "../../utils/formatters";
|
|||||||
import { BacklinksList, useBacklinkCount } from "../FloatingButtonsDefinitions";
|
import { BacklinksList, useBacklinkCount } from "../FloatingButtonsDefinitions";
|
||||||
import Dropdown, { DropdownProps } from "../react/Dropdown";
|
import Dropdown, { DropdownProps } from "../react/Dropdown";
|
||||||
import { FormDropdownDivider, FormListItem } from "../react/FormList";
|
import { FormDropdownDivider, FormListItem } from "../react/FormList";
|
||||||
import { useActiveNoteContext, useStaticTooltip, useTriliumEvent } from "../react/hooks";
|
import { useActiveNoteContext, useLegacyImperativeHandlers, useStaticTooltip, useTriliumEvent } from "../react/hooks";
|
||||||
import Icon from "../react/Icon";
|
import Icon from "../react/Icon";
|
||||||
import { ParentComponent } from "../react/react_utils";
|
import { ParentComponent } from "../react/react_utils";
|
||||||
import { ContentLanguagesModal, useLanguageSwitcher } from "../ribbon/BasicPropertiesTab";
|
import { ContentLanguagesModal, useLanguageSwitcher } from "../ribbon/BasicPropertiesTab";
|
||||||
@@ -283,6 +283,13 @@ function AttributesPane({ note, noteContext, shown }: StatusBarContext & {
|
|||||||
hidden: !note
|
hidden: !note
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Interaction with the attribute editor.
|
||||||
|
useLegacyImperativeHandlers(useMemo(() => ({
|
||||||
|
saveAttributesCommand: () => api.current?.save(),
|
||||||
|
reloadAttributesCommand: () => api.current?.refresh(),
|
||||||
|
updateAttributeListCommand: ({ attributes }) => api.current?.renderOwnedAttributes(attributes)
|
||||||
|
}), [ api ]));
|
||||||
|
|
||||||
return (context &&
|
return (context &&
|
||||||
<div className={clsx("attribute-list", !shown && "hidden-ext")}>
|
<div className={clsx("attribute-list", !shown && "hidden-ext")}>
|
||||||
<InheritedAttributesTab {...context} />
|
<InheritedAttributesTab {...context} />
|
||||||
|
|||||||
Reference in New Issue
Block a user