aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ColorBox.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-10-16 23:50:27 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-10-16 23:50:27 -0400
commitcaebaeca6993ff48609ab16dcc390d4d0458b03a (patch)
tree1f35d8f38e1f56c046b4b5585bd22b6f70bcd500 /src/client/views/nodes/ColorBox.tsx
parent7763a08eb5ed931dbf854e2b72d07b7613791e2b (diff)
fixed applying templates to collections. fixed templates containing collections
Diffstat (limited to 'src/client/views/nodes/ColorBox.tsx')
-rw-r--r--src/client/views/nodes/ColorBox.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/views/nodes/ColorBox.tsx b/src/client/views/nodes/ColorBox.tsx
index e4fef0922..30554ea36 100644
--- a/src/client/views/nodes/ColorBox.tsx
+++ b/src/client/views/nodes/ColorBox.tsx
@@ -25,9 +25,8 @@ export class ColorBox extends DocStaticComponent<FieldViewProps, ColorDocument>(
this._selectedDisposer = reaction(() => SelectionManager.SelectedDocuments(),
action(() => this._startupColor = SelectionManager.SelectedDocuments().length ? StrCast(SelectionManager.SelectedDocuments()[0].Document.backgroundColor, "black") : "black"),
{ fireImmediately: true });
- this._penDisposer = reaction(() => CurrentUserUtils.UserDocument.activePen instanceof Doc && CurrentUserUtils.UserDocument.activePen.pen,
- action(() => this._startupColor = CurrentUserUtils.UserDocument.activePen instanceof Doc && CurrentUserUtils.UserDocument.activePen.pen instanceof Doc ?
- StrCast(CurrentUserUtils.UserDocument.activePen.pen.backgroundColor, "black") : "black"),
+ this._penDisposer = reaction(() => CurrentUserUtils.ActivePen,
+ action(() => this._startupColor = CurrentUserUtils.ActivePen ? StrCast(CurrentUserUtils.ActivePen.backgroundColor, "black") : "black"),
{ fireImmediately: true });
// compare to this reaction that used to be in Selection Manager
@@ -36,7 +35,7 @@ export class ColorBox extends DocStaticComponent<FieldViewProps, ColorDocument>(
// if (sel.length > 0) {
// let firstView = sel[0];
// let doc = firstView.props.Document;
- // let targetDoc = doc.isTemplate ? doc : Doc.GetProto(doc);
+ // let targetDoc = doc.isTemplateField ? doc : Doc.GetProto(doc);
// let stored = StrCast(targetDoc.backgroundColor);
// stored.length > 0 && (targetColor = stored);
// }