aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samuel_wilkins@brown.edu>2019-06-26 23:19:32 -0400
committerSam Wilkins <samuel_wilkins@brown.edu>2019-06-26 23:19:32 -0400
commit4d16af0870f183b24b83e7b5c9a25b53796a23af (patch)
treeeecf82cd7c7b39aac609c0d890d913756473d0f1 /src/client/views/DocumentDecorations.tsx
parent18b568ce20b66c4e16521c043df804279a5cd163 (diff)
parent9178f360cbc3de7d836387a38e4e1ce6b7c77710 (diff)
Merge branch 'templatesMac' of https://github.com/browngraphicslab/Dash-Web into templatesMac
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 557db3639..0a77ae515 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -5,7 +5,6 @@ import { action, computed, observable, reaction, runInAction } from "mobx";
import { observer } from "mobx-react";
import { Doc } from "../../new_fields/Doc";
import { List } from "../../new_fields/List";
-import { listSpec } from "../../new_fields/Schema";
import { BoolCast, Cast, NumCast, StrCast } from "../../new_fields/Types";
import { URLField } from '../../new_fields/URLField';
import { emptyFunction, Utils } from "../../Utils";
@@ -25,6 +24,7 @@ import { LinkMenu } from "./nodes/LinkMenu";
import { TemplateMenu } from "./TemplateMenu";
import { Template, Templates } from "./Templates";
import React = require("react");
+import { LinkManager } from '../util/LinkManager';
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
export const Flyout = higflyout.default;
@@ -600,9 +600,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
let linkButton = null;
if (SelectionManager.SelectedDocuments().length > 0) {
let selFirst = SelectionManager.SelectedDocuments()[0];
- let linkToSize = Cast(selFirst.props.Document.linkedToDocs, listSpec(Doc), []).length;
- let linkFromSize = Cast(selFirst.props.Document.linkedFromDocs, listSpec(Doc), []).length;
- let linkCount = linkToSize + linkFromSize;
+ let linkCount = LinkManager.Instance.getAllRelatedLinks(selFirst.props.Document).length;
linkButton = (<Flyout
anchorPoint={anchorPoints.RIGHT_TOP}
content={<LinkMenu docView={selFirst}