MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / start

Method start

apps/client/src/code/pages/page/elems/editing.ts:50–87  ·  view source on GitHub ↗
(elem: PageNote | PageArrow, section?: NoteTextSection)

Source from the content-addressed store, hash-verified

48 }
49
50 async start(elem: PageNote | PageArrow, section?: NoteTextSection) {
51 if (this.react.elemId === elem.id) {
52 return;
53 }
54
55 if (this.react.active) {
56 this.stop();
57 }
58
59 if (this.page.react.readOnly || elem.react.collab.readOnly) {
60 return;
61 }
62
63 elem.react.editing = true;
64
65 this.react.elemId = elem.id;
66
67 if (elem.type === 'note') {
68 if (section != null) {
69 this.react.section = section;
70 } else if (elem.react.topSection !== 'container') {
71 this.react.section = elem.react.topSection;
72 }
73 }
74
75 this.page.selection.set(elem);
76
77 await nextTick();
78 await watchUntilTrue(() => elem.react.loaded);
79
80 this.page.selection.set(elem);
81
82 for (const editor of elem.react.editors) {
83 editor.setEditable(true);
84 }
85
86 this.react.editor?.commands.focus('all', { scrollIntoView: false });
87 }
88
89 stop() {
90 if (this.react.elem == null) {

Callers 3

focusCurrentResultMethod · 0.45
useEditingOnTypingFunction · 0.45
onKeyDownFunction · 0.45

Calls 3

stopMethod · 0.95
watchUntilTrueFunction · 0.90
setMethod · 0.65

Tested by

no test coverage detected