From e5312b1b568512d744dd9e4829a3ece12620cbbc Mon Sep 17 00:00:00 2001 From: bob Date: Thu, 30 Jan 2020 10:40:40 -0500 Subject: changed syntax to [[(doc)?(:field]] for embedding doc as text blocks. added {{doc}} for embedding a document --- src/client/views/TemplateMenu.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/client/views/TemplateMenu.tsx') diff --git a/src/client/views/TemplateMenu.tsx b/src/client/views/TemplateMenu.tsx index 2f36d4fbd..d5554fd4f 100644 --- a/src/client/views/TemplateMenu.tsx +++ b/src/client/views/TemplateMenu.tsx @@ -41,7 +41,7 @@ class OtherToggle extends React.Component<{ checked: boolean, name: string, togg } export interface TemplateMenuProps { - docs: DocumentView[]; + docViews: DocumentView[]; templates: Map; } @@ -51,12 +51,12 @@ export class TemplateMenu extends React.Component { @observable private _hidden: boolean = true; toggleLayout = (e: React.ChangeEvent, layout: string): void => { - this.props.docs.map(dv => dv.setCustomView(e.target.checked, layout)); + this.props.docViews.map(dv => dv.setCustomView(e.target.checked, layout)); } toggleFloat = (e: React.ChangeEvent): void => { SelectionManager.DeselectAll(); - const topDocView = this.props.docs[0]; + const topDocView = this.props.docViews[0]; const ex = e.target.getBoundingClientRect().left; const ey = e.target.getBoundingClientRect().top; DocumentView.FloatDoc(topDocView, ex, ey); @@ -67,9 +67,9 @@ export class TemplateMenu extends React.Component { @action toggleTemplate = (event: React.ChangeEvent, template: Template): void => { if (event.target.checked) { - this.props.docs.map(d => d.Document["show" + template.Name] = template.Name.toLowerCase()); + this.props.docViews.map(d => d.Document["show" + template.Name] = template.Name.toLowerCase()); } else { - this.props.docs.map(d => d.Document["show" + template.Name] = ""); + this.props.docViews.map(d => d.Document["show" + template.Name] = ""); } } @@ -81,7 +81,7 @@ export class TemplateMenu extends React.Component { @undoBatch @action toggleChrome = (): void => { - this.props.docs.map(dv => { + this.props.docViews.map(dv => { const layout = Doc.Layout(dv.Document); layout._chromeStatus = (layout._chromeStatus !== "disabled" ? "disabled" : "enabled"); }); @@ -95,7 +95,7 @@ export class TemplateMenu extends React.Component { } componentDidMount() { !TemplateMenu._addedKeys && (TemplateMenu._addedKeys = new ObservableSet(["narrative"])); - Array.from(Object.keys(Doc.GetProto(this.props.docs[0].props.Document))). + Array.from(Object.keys(Doc.GetProto(this.props.docViews[0].props.Document))). filter(key => key.startsWith("layout_")). map(key => runInAction(() => TemplateMenu._addedKeys.add(key.replace("layout_", "")))); DocListCast(Cast(CurrentUserUtils.UserDocument.expandingButtons, Doc, null)?.data)?.map(btnDoc => { @@ -108,14 +108,14 @@ export class TemplateMenu extends React.Component { static _addedKeys = new ObservableSet(["narrative"]); _customRef = React.createRef(); render() { - const layout = Doc.Layout(this.props.docs[0].Document); + const layout = Doc.Layout(this.props.docViews[0].Document); const templateMenu: Array = []; this.props.templates.forEach((checked, template) => templateMenu.push()); - templateMenu.push(); + templateMenu.push(); templateMenu.push(); TemplateMenu._addedKeys && Array.from(TemplateMenu._addedKeys).map(layout => - templateMenu.push( this.toggleLayout(e, layout)} />) + templateMenu.push( this.toggleLayout(e, layout)} />) ); return
    {templateMenu} -- cgit v1.2.3-70-g09d2