aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/TemplateMenu.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-01-31 11:05:03 -0500
committerSam Wilkins <samwilkins333@gmail.com>2020-01-31 11:05:03 -0500
commit5ad15ac012262ac15e152b995cbcb042c5b7cf89 (patch)
treefcd3404add281aff240aeb4c9546d0ba16b7d8ec /src/client/views/TemplateMenu.tsx
parent96de4bf18d5721d2b7957d7adb8ad3393462c4d1 (diff)
parentb0544ea44ef78a93deb9290815f95d6d9308447d (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/TemplateMenu.tsx')
-rw-r--r--src/client/views/TemplateMenu.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/TemplateMenu.tsx b/src/client/views/TemplateMenu.tsx
index d5554fd4f..f61eb9cd0 100644
--- a/src/client/views/TemplateMenu.tsx
+++ b/src/client/views/TemplateMenu.tsx
@@ -90,22 +90,22 @@ export class TemplateMenu extends React.Component<TemplateMenuProps> {
// todo: add brushes to brushMap to save with a style name
onCustomKeypress = (e: React.KeyboardEvent) => {
if (e.key === "Enter") {
- runInAction(() => TemplateMenu._addedKeys.add(this._customRef.current!.value));
+ runInAction(() => this._addedKeys.add(this._customRef.current!.value));
}
}
componentDidMount() {
- !TemplateMenu._addedKeys && (TemplateMenu._addedKeys = new ObservableSet(["narrative"]));
+ !this._addedKeys && (this._addedKeys = new ObservableSet());
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_", ""))));
+ map(key => runInAction(() => this._addedKeys.add(key.replace("layout_", ""))));
DocListCast(Cast(CurrentUserUtils.UserDocument.expandingButtons, Doc, null)?.data)?.map(btnDoc => {
if (StrCast(Cast(btnDoc?.dragFactory, Doc, null)?.title)) {
- runInAction(() => TemplateMenu._addedKeys.add(StrCast(Cast(btnDoc?.dragFactory, Doc, null)?.title)));
+ runInAction(() => this._addedKeys.add(StrCast(Cast(btnDoc?.dragFactory, Doc, null)?.title)));
}
});
}
- static _addedKeys = new ObservableSet(["narrative"]);
+ _addedKeys = new ObservableSet();
_customRef = React.createRef<HTMLInputElement>();
render() {
const layout = Doc.Layout(this.props.docViews[0].Document);
@@ -114,7 +114,7 @@ export class TemplateMenu extends React.Component<TemplateMenuProps> {
templateMenu.push(<TemplateToggle key={template.Name} template={template} checked={checked} toggle={this.toggleTemplate} />));
templateMenu.push(<OtherToggle key={"float"} name={"Float"} checked={this.props.docViews[0].Document.z ? true : false} toggle={this.toggleFloat} />);
templateMenu.push(<OtherToggle key={"chrome"} name={"Chrome"} checked={layout._chromeStatus !== "disabled"} toggle={this.toggleChrome} />);
- TemplateMenu._addedKeys && Array.from(TemplateMenu._addedKeys).map(layout =>
+ this._addedKeys && Array.from(this._addedKeys).map(layout =>
templateMenu.push(<OtherToggle key={layout} name={layout} checked={StrCast(this.props.docViews[0].Document.layoutKey, "layout") === "layout_" + layout} toggle={e => this.toggleLayout(e, layout)} />)
);
return <ul className="template-list" style={{ display: "block" }}>