diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-06-26 01:10:12 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-06-26 01:10:12 -0400 |
commit | eaee04b09b9b91587733f2d8554d6176ae2e678d (patch) | |
tree | 846047e8fe6170f9c69650ad7d5b42370b423971 /src | |
parent | 058ab55074b5b3e1d8278d83af39e185acdcde73 (diff) |
fix to setting text color
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/ColorBox.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/nodes/ColorBox.tsx b/src/client/views/nodes/ColorBox.tsx index d6d9a8cfd..137b387c0 100644 --- a/src/client/views/nodes/ColorBox.tsx +++ b/src/client/views/nodes/ColorBox.tsx @@ -39,7 +39,7 @@ export class ColorBox extends ViewBoxBaseComponent<FieldViewProps, ColorDocument if (view.props.LayoutTemplate?.() || view.props.LayoutTemplateString) { // this situation typically occurs when you have a link dot targetDoc.backgroundColor = Doc.UserDoc().backgroundColor; // bcz: don't know how to change the color of an inline template... } - else if (StrCast(Doc.Layout(view.props.Document).layout).includes("FormattedTextBox") && FormattedTextBox.HadSelection) { + else if (StrCast(Doc.Layout(view.props.Document).layout).includes("FormattedTextBox") && window.getSelection()?.toString() !== "") { Doc.Layout(view.props.Document)[Doc.LayoutFieldKey(view.props.Document) + "-color"] = Doc.UserDoc().backgroundColor; } else { Doc.Layout(view.props.Document)._backgroundColor = Doc.UserDoc().backgroundColor; // '_backgroundColor' is template specific. 'backgroundColor' would apply to all templates, but has no UI at the moment |