aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/TemplateMenu.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-06-11 10:53:36 -0400
committerbob <bcz@cs.brown.edu>2019-06-11 10:53:36 -0400
commit95674ee7f68782d1ce85858120efea956825bcb9 (patch)
tree0d2ddc9838b45278d6533099f7030a9713d6413f /src/client/views/TemplateMenu.tsx
parent4dacd1220e6a0ef73167f187f52f3b4c222c2586 (diff)
parent06d5bb5c65da6f4a115ebf8118989115420bccef (diff)
merged embedded linking with master
Diffstat (limited to 'src/client/views/TemplateMenu.tsx')
-rw-r--r--src/client/views/TemplateMenu.tsx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/client/views/TemplateMenu.tsx b/src/client/views/TemplateMenu.tsx
index 22c4edc25..3288abd90 100644
--- a/src/client/views/TemplateMenu.tsx
+++ b/src/client/views/TemplateMenu.tsx
@@ -1,12 +1,11 @@
-import { observable, computed, action, trace } from "mobx";
-import React = require("react");
+import { action, observable } from "mobx";
import { observer } from "mobx-react";
+import { Doc } from "../../new_fields/Doc";
+import { List } from "../../new_fields/List";
import './DocumentDecorations.scss';
-import { Template } from "./Templates";
import { DocumentView } from "./nodes/DocumentView";
-import { List } from "../../new_fields/List";
-import { Doc } from "../../new_fields/Doc";
-import { NumCast } from "../../new_fields/Types";
+import { Template } from "./Templates";
+import React = require("react");
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
export const Flyout = higflyout.default;
@@ -43,16 +42,16 @@ export class TemplateMenu extends React.Component<TemplateMenuProps> {
@action
toggleTemplate = (event: React.ChangeEvent<HTMLInputElement>, template: Template): void => {
if (event.target.checked) {
- if (template.Name == "Bullet") {
+ if (template.Name === "Bullet") {
let topDocView = this.props.docs[0];
topDocView.addTemplate(template);
- topDocView.props.Document.subBulletDocs = new List<Doc>(this.props.docs.filter(v => v !== topDocView).map(v => v.props.Document));
+ topDocView.props.Document.subBulletDocs = new List<Doc>(this.props.docs.filter(v => v !== topDocView).map(v => v.props.Document.proto!));
} else {
this.props.docs.map(d => d.addTemplate(template));
}
this.props.templates.set(template, true);
} else {
- if (template.Name == "Bullet") {
+ if (template.Name === "Bullet") {
let topDocView = this.props.docs[0];
topDocView.removeTemplate(template);
topDocView.props.Document.subBulletDocs = undefined;