From 83d3756537cfcd8a2248c4b8a2a6f75f77154602 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 9 Nov 2020 21:40:59 -0500
Subject: fixed autoHeight for formattedTextSidebars when the text document has
 been scaled.  cleaned up link groups.  fixed pushpins that don't focus on
 target (e.g., a si m ple pushpin on a PDF).

---
 src/client/views/linking/LinkMenu.tsx | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

(limited to 'src/client/views/linking/LinkMenu.tsx')

diff --git a/src/client/views/linking/LinkMenu.tsx b/src/client/views/linking/LinkMenu.tsx
index 3b4912d3d..54b597f59 100644
--- a/src/client/views/linking/LinkMenu.tsx
+++ b/src/client/views/linking/LinkMenu.tsx
@@ -59,24 +59,17 @@ export class LinkMenu extends React.Component<Props> {
     }
 
     renderAllGroups = (groups: Map<string, Array<Doc>>): Array<JSX.Element> => {
-        const linkItems: Array<JSX.Element> = [];
-        groups.forEach((group, groupType) => {
-            linkItems.push(
-                <LinkMenuGroup
-                    key={groupType}
-                    docView={this.props.docView}
-                    sourceDoc={this.props.docView.props.Document}
-                    group={group}
-                    groupType={groupType}
-                    showEditor={action((linkDoc: Doc) => this._editingLink = linkDoc)}
-                    addDocTab={this.props.addDocTab} />
-            );
-        });
-
-        // if source doc has no links push message
-        if (linkItems.length === 0) linkItems.push(<p key="">No links have been created yet. Drag the linking button onto another document to create a link.</p>);
-
-        return linkItems;
+        const linkItems = Array.from(groups.entries()).map(group =>
+            <LinkMenuGroup
+                key={group[0]}
+                docView={this.props.docView}
+                sourceDoc={this.props.docView.props.Document}
+                group={group[1]}
+                groupType={group[0]}
+                showEditor={action(linkDoc => this._editingLink = linkDoc)}
+                addDocTab={this.props.addDocTab} />);
+
+        return linkItems.length ? linkItems : [<p key="">No links have been created yet. Drag the linking button onto another document to create a link.</p>];
     }
 
     @computed
-- 
cgit v1.2.3-70-g09d2

