mirror of
https://github.com/zadam/trilium.git
synced 2025-11-26 02:24:23 +01:00
chore(quick_edit): bring back focus
This commit is contained in:
parent
bb9cb2fb75
commit
2f440eba37
@ -12,6 +12,7 @@ const noteContext = new NoteContext("_popup-editor");
|
|||||||
|
|
||||||
export default function PopupEditor() {
|
export default function PopupEditor() {
|
||||||
const [ shown, setShown ] = useState(false);
|
const [ shown, setShown ] = useState(false);
|
||||||
|
const parentComponent = useContext(ParentComponent);
|
||||||
|
|
||||||
useTriliumEvent("openInPopup", async ({ noteIdOrPath }) => {
|
useTriliumEvent("openInPopup", async ({ noteIdOrPath }) => {
|
||||||
await noteContext.setNote(noteIdOrPath, {
|
await noteContext.setNote(noteIdOrPath, {
|
||||||
@ -30,6 +31,9 @@ export default function PopupEditor() {
|
|||||||
className="popup-editor-dialog"
|
className="popup-editor-dialog"
|
||||||
size="lg"
|
size="lg"
|
||||||
show={shown}
|
show={shown}
|
||||||
|
onShown={() => {
|
||||||
|
parentComponent?.handleEvent("focusOnDetail", { ntxId: noteContext.ntxId });
|
||||||
|
}}
|
||||||
onHidden={() => setShown(false)}
|
onHidden={() => setShown(false)}
|
||||||
>
|
>
|
||||||
<NoteDetail />
|
<NoteDetail />
|
||||||
|
|||||||
@ -58,7 +58,6 @@ export default class PopupEditorDialog extends Container<BasicWidget> {
|
|||||||
|
|
||||||
$dialog.on("shown.bs.modal", async () => {
|
$dialog.on("shown.bs.modal", async () => {
|
||||||
this.setVisibility(true);
|
this.setVisibility(true);
|
||||||
await this.handleEventInChildren("focusOnDetail", { ntxId: this.noteContext.ntxId });
|
|
||||||
});
|
});
|
||||||
$dialog.on("hidden.bs.modal", () => {
|
$dialog.on("hidden.bs.modal", () => {
|
||||||
const $typeWidgetEl = $dialog.find(".note-detail-printable");
|
const $typeWidgetEl = $dialog.find(".note-detail-printable");
|
||||||
|
|||||||
@ -41,7 +41,6 @@ export default function CKEditorWithWatchdog({ containerRef: externalContainerRe
|
|||||||
const [ editor, setEditor ] = useState<CKTextEditor>();
|
const [ editor, setEditor ] = useState<CKTextEditor>();
|
||||||
const { parentComponent, ntxId } = useNoteContext();
|
const { parentComponent, ntxId } = useNoteContext();
|
||||||
|
|
||||||
console.log("Register with ntxId", ntxId);
|
|
||||||
useKeyboardShortcuts("text-detail", containerRef, parentComponent, ntxId);
|
useKeyboardShortcuts("text-detail", containerRef, parentComponent, ntxId);
|
||||||
|
|
||||||
useImperativeHandle(editorApi, () => ({
|
useImperativeHandle(editorApi, () => ({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user