diff options
| author | Fawn <fangrui_tong@brown.edu> | 2019-04-01 17:22:49 -0400 |
|---|---|---|
| committer | Fawn <fangrui_tong@brown.edu> | 2019-04-01 17:22:49 -0400 |
| commit | 5246c3c38acda6cbd8636577ff8f658657609d88 (patch) | |
| tree | 6c8e055add9837a8d050de7498f7d4d8432c6215 /src/client/views/DocumentDecorations.tsx | |
| parent | 0ae1eac2e2b26c0eee747c81ea1478118b4ec874 (diff) | |
set up for templating
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 47098c3b5..6d60f9740 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -9,6 +9,7 @@ import { props } from "bluebird"; import { DragManager } from "../util/DragManager"; import { LinkMenu } from "./nodes/LinkMenu"; import { ListField } from "../../fields/ListField"; +import { Templates } from "./Templates"; const higflyout = require("@hig/flyout"); export const { anchorPoints } = higflyout; export const Flyout = higflyout.default; @@ -192,6 +193,22 @@ export class DocumentDecorations extends React.Component { // e.stopPropagation(); // } + addTemplate = (): void => { + console.log("add template"); + let text = ` + <div> + <div style="margin:auto; height:calc(100%); width:100%;"> + {layout} + </div> + <div style="height:(100% + 25px); width:100%; position:absolute"> + <FormattedTextBox doc={Document} DocumentViewForField={DocumentView} bindings={bindings} fieldKey={"CaptionKey"} isSelected={isSelected} select={select} selectOnLoad={SelectOnLoad} isTopMost={isTopMost}/> + </div> + </div> + `; + let view = SelectionManager.SelectedDocuments()[0]; + view.addTemplate(Templates.OuterCaption); + } + render() { var bounds = this.Bounds; if (this.Hidden) { @@ -236,6 +253,8 @@ export class DocumentDecorations extends React.Component { <div title="View Links" className="linkFlyout" ref={this._linkButton}>{linkButton}</div> + <div className="templating-button" onClick={this.addTemplate}></div> + </div > ) } |
