diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-03 02:57:56 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-03 02:57:56 -0400 |
| commit | 64b5971a6d456332b6124d994ec9bd504759b93b (patch) | |
| tree | 0c7a16aaaa40198538eef15b607c0726007a7106 /src/client/views/nodes/formattedText/RichTextMenu.tsx | |
| parent | 1749944379d80acf0429a3662e3254f2e1e2f087 (diff) | |
| parent | 36f9a30619416e2cbef93bddd045ed262f9fe4fa (diff) | |
Merge branch 'master' into menu_restructure
Diffstat (limited to 'src/client/views/nodes/formattedText/RichTextMenu.tsx')
| -rw-r--r-- | src/client/views/nodes/formattedText/RichTextMenu.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/views/nodes/formattedText/RichTextMenu.tsx b/src/client/views/nodes/formattedText/RichTextMenu.tsx index d7eb73bb4..d7b6da52e 100644 --- a/src/client/views/nodes/formattedText/RichTextMenu.tsx +++ b/src/client/views/nodes/formattedText/RichTextMenu.tsx @@ -437,10 +437,16 @@ export default class RichTextMenu extends AntimodeMenu { } changeFontSize = (mark: Mark, view: EditorView) => { + if ((this.view?.state.selection.$from.pos || 0) < 2) { + this.TextView.layoutDoc._fontSize = mark.attrs.fontSize; + } this.setMark(view.state.schema.marks.pFontSize.create({ fontSize: mark.attrs.fontSize }), view.state, view.dispatch, true); } changeFontFamily = (mark: Mark, view: EditorView) => { + if ((this.view?.state.selection.$from.pos || 0) < 2) { + this.TextView.layoutDoc._fontFamily = mark.attrs.family; + } this.setMark(view.state.schema.marks.pFontFamily.create({ family: mark.attrs.family }), view.state, view.dispatch, true); } |
