From 6c8effb77029db96bccab92152a6b68a0aefc132 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 1 Apr 2025 13:30:06 -0400 Subject: fixed text views to write/read font_ from data doc. --- src/client/views/global/globalScripts.ts | 4 +-- .../views/nodes/formattedText/FormattedTextBox.tsx | 38 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts index 79d0ee88f..04b2873d1 100644 --- a/src/client/views/global/globalScripts.ts +++ b/src/client/views/global/globalScripts.ts @@ -367,8 +367,8 @@ ScriptingGlobals.add(function toggleCharStyle(charStyle: attrname, checkResult?: toggle: () => editorView?.state && RichTextMenu.Instance?.changeListType(list) }]); // prettier-ignore const attrs:attrfuncs[] = [ - ['dictation', { checkResult: () => !!textView?._recordingDictation, - toggle: () => textView && runInAction(() => { textView._recordingDictation = !textView._recordingDictation;} ) }], + ['dictation', { checkResult: () => !!textView?.recordingDictation, + toggle: () => textView && runInAction(() => { textView.recordingDictation = !textView.recordingDictation;} ) }], ['fitBox', { checkResult: () => RichTextMenu.Instance?.fitBox ?? false, toggle: () => RichTextMenu.Instance?.toggleFitBox()}], ['elide', { checkResult: () => false, diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 6955e5401..f7e6d8e1e 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -141,20 +141,20 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent { - if (this.EditorView && this._recordingDictation) { + if (this.EditorView && this.recordingDictation) { this.stopDictation(/* true */); this._break = true; const { state } = this.EditorView; const { to } = state.selection; const updated = TextSelection.create(state.doc, to, to); this.EditorView.dispatch(state.tr.setSelection(updated).insert(to, state.schema.nodes.paragraph.create({}))); - if (this._recordingDictation) { + if (this.recordingDictation) { this.recordDictation(); } } @@ -1333,14 +1333,14 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent this._recordingDictation, + () => this.recordingDictation, () => { this.stopDictation(/* true */); - this._recordingDictation && this.recordDictation(); + this.recordingDictation && this.recordDictation(); }, { fireImmediately: true } ); - if (this._recordingDictation) setTimeout(this.recordDictation); + if (this.recordingDictation) setTimeout(this.recordDictation); } this._disposers.scroll = reaction( () => NumCast(this.layoutDoc._layout_scrollTop), @@ -1560,8 +1560,8 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent disposer?.()); this.endUndoTypingBatch(); @@ -1596,7 +1596,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent @@ -1919,7 +1919,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent { - this._recordingDictation = !this._recordingDictation; + this.recordingDictation = !this.recordingDictation; }) ) }> -- cgit v1.2.3-70-g09d2