aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2020-02-18 17:10:25 -0500
committerbob <bcz@cs.brown.edu>2020-02-18 17:10:25 -0500
commit86a018749528e3b249bc0440e9d791c28b227532 (patch)
treedf6981c21edc0c35924cbc3c1fc37fcc66431d29 /src/client/views/collections
parente5d5ed0e7c4d594777d2bdf0347242b11157b32f (diff)
fixed up following link to a portal alias. made renaming goldenlayout tabs write to the proto.
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx2
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeView.tsx9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 902016365..26b65c898 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -433,7 +433,7 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
tab.titleElement[0].onclick = (e: any) => tab.titleElement[0].focus();
tab.titleElement[0].onchange = (e: any) => {
tab.titleElement[0].size = e.currentTarget.value.length + 1;
- Doc.SetInPlace(doc, "title", e.currentTarget.value, true);
+ Doc.GetProto(doc).title = e.currentTarget.value, true;
};
tab.titleElement[0].size = StrCast(doc.title).length + 1;
tab.titleElement[0].value = doc.title;
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index 1db963fa4..3cfefc25e 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -17,6 +17,7 @@ import { SubCollectionViewProps } from "../CollectionSubView";
import MarqueeOptionsMenu from "./MarqueeOptionsMenu";
import "./MarqueeView.scss";
import React = require("react");
+import { CollectionView } from "../CollectionView";
interface MarqueeViewProps {
getContainerTransform: () => Transform;
@@ -354,8 +355,14 @@ export class MarqueeView extends React.Component<SubCollectionViewProps & Marque
d.page = -1;
return d;
});
- const summary = Docs.Create.TextDocument("", { x: bounds.left, y: bounds.top, _width: 200, _height: 200, _fitToBox: true, _showSidebar: true, backgroundColor: "#e2ad32" /* yellow */, title: "-summary-" });
+ const summary = Docs.Create.TextDocument("", { x: bounds.left + bounds.width / 2, y: bounds.top + bounds.height / 2, _width: 200, _height: 200, _fitToBox: true, _showSidebar: true, title: "-summary-" });
+ const portal = Doc.MakeAlias(summary);
Doc.GetProto(summary)["data-annotations"] = new List<Doc>(selected);
+ Doc.GetProto(summary).layout_portal = CollectionView.LayoutString("data-annotations");
+ summary._backgroundColor = "#e2ad32";
+ portal.layoutKey = "layout_portal";
+ DocUtils.MakeLink({ doc: summary, ctx: this.props.ContainingCollectionDoc }, { doc: portal }, "portal link", "portal link");
+
this.props.addLiveTextDocument(summary);
MarqueeOptionsMenu.Instance.fadeOut(true);
}