aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorSam Wilkins <35748010+samwilkins333@users.noreply.github.com>2020-02-12 19:02:15 -0500
committerSam Wilkins <35748010+samwilkins333@users.noreply.github.com>2020-02-12 19:02:15 -0500
commit5dfd071b082d9c2000508ec680009746d35a72bd (patch)
tree31ced9548bb9074ad6808e4363b291a4ce638682 /src/client/views/nodes/DocumentView.tsx
parent28079636e5b58f587ec42cbb49f629165181296c (diff)
parent6489427020825657e29e9663b888a3a1cd1d81e0 (diff)
Merge branch 'fixhero' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 84a4e2649..48df1ea33 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -232,7 +232,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
e.stopPropagation();
e.preventDefault();
if (e.key === "†" || e.key === "t") {
- if (!StrCast(this.layoutDoc.showTitle)) this.layoutDoc.showTitle = "title";
+ if (!StrCast(this.layoutDoc._showTitle)) this.layoutDoc._showTitle = "title";
if (!this._titleRef.current) setTimeout(() => this._titleRef.current?.setIsFocused(true), 0);
else if (!this._titleRef.current.setIsFocused(true)) { // if focus didn't change, focus on interior text...
{
@@ -807,16 +807,16 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
// does Document set a layout prop
setsLayoutProp = (prop: string) => this.props.Document[prop] !== this.props.Document["default" + prop[0].toUpperCase() + prop.slice(1)] && this.props.Document["default" + prop[0].toUpperCase() + prop.slice(1)];
// get the a layout prop by first choosing the prop from Document, then falling back to the layout doc otherwise.
- getLayoutPropStr = (prop: string) => StrCast(this.setsLayoutProp(prop) ? this.props.Document[prop] : this.layoutDoc[prop]);
+ getLayoutPropStr = (prop: string) => {
+ return StrCast(this.setsLayoutProp(prop) ? this.props.Document[prop] : Cast(this.layoutDoc?.expandedTemplate, Doc, null)?.[prop] || this.layoutDoc[prop]);
+ }
getLayoutPropNum = (prop: string) => NumCast(this.setsLayoutProp(prop) ? this.props.Document[prop] : this.layoutDoc[prop]);
isSelected = (outsideReaction?: boolean) => SelectionManager.IsSelected(this, outsideReaction);
select = (ctrlPressed: boolean) => { SelectionManager.SelectDoc(this, ctrlPressed); };
chromeHeight = () => {
- const showTitle = StrCast(this.layoutDoc.showTitle);
- const showTitleHover = StrCast(this.layoutDoc.showTitleHover);
- return (showTitle && !showTitleHover ? 0 : 0) + 1;
+ return 1;
}
@computed get finalLayoutKey() {
@@ -874,8 +874,8 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
@computed get innards() {
TraceMobx();
- const showTitle = StrCast(this.getLayoutPropStr("showTitle"));
- const showTitleHover = StrCast(this.getLayoutPropStr("showTitleHover"));
+ const showTitle = StrCast(this.getLayoutPropStr("_showTitle"));
+ const showTitleHover = StrCast(this.getLayoutPropStr("_showTitleHover"));
const showCaption = this.getLayoutPropStr("showCaption");
const showTextTitle = showTitle && (StrCast(this.layoutDoc.layout).indexOf("PresBox") !== -1 || StrCast(this.layoutDoc.layout).indexOf("FormattedTextBox") !== -1) ? showTitle : undefined;
const searchHighlight = (!this.Document.searchFields ? (null) :