From dc20420e4757824974ba4b2ea3926d541f5e8b60 Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Thu, 4 Apr 2019 20:13:19 -0400
Subject: fixed merge

---
 src/client/views/DocumentDecorations.tsx | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

(limited to 'src/client/views/DocumentDecorations.tsx')

diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 99588480d..11bf24505 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -55,9 +55,9 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
     enterPressed = (e: any) => {
         var key = e.keyCode || e.which;
         // enter pressed
-        if (key == 13) {
+        if (key === 13) {
             var text = e.target.value;
-            if (text[0] == '#') {
+            if (text[0] === '#') {
                 let command = text.slice(1, text.length);
                 this._fieldKey = new Key(command)
                 // if (command == "Title" || command == "title") {
@@ -156,7 +156,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
     onCloseUp = (e: PointerEvent): void => {
         e.stopPropagation();
         if (e.button === 0) {
-            SelectionManager.SelectedDocuments().map(dv => dv.props.RemoveDocument && dv.props.RemoveDocument(dv.props.Document));
+            SelectionManager.SelectedDocuments().map(dv => dv.props.removeDocument && dv.props.removeDocument(dv.props.Document));
             SelectionManager.DeselectAll();
             document.removeEventListener("pointermove", this.onCloseMove);
             document.removeEventListener("pointerup", this.onCloseUp);
@@ -211,7 +211,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
     }
 
     onLinkerButtonMoved = (e: PointerEvent): void => {
-        if (this._linkerButton.current != null) {
+        if (this._linkerButton.current !== null) {
             document.removeEventListener("pointermove", this.onLinkerButtonMoved)
             document.removeEventListener("pointerup", this.onLinkerButtonUp)
             let dragData = new DragManager.LinkDragData(SelectionManager.SelectedDocuments()[0]);
@@ -240,25 +240,24 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
     }
 
     onLinkButtonMoved = async (e: PointerEvent) => {
-        if (this._linkButton.current != null) {
+        if (this._linkButton.current !== null) {
             document.removeEventListener("pointermove", this.onLinkButtonMoved)
             document.removeEventListener("pointerup", this.onLinkButtonUp);
 
             let sourceDoc = SelectionManager.SelectedDocuments()[0].props.Document;
             let srcTarg = sourceDoc.GetT(KeyStore.Prototype, Document)
-            let draggedDocs = (srcTarg && srcTarg != FieldWaiting) ?
+            let draggedDocs = (srcTarg && srcTarg !== FieldWaiting) ?
                 srcTarg.GetList(KeyStore.LinkedToDocs, [] as Document[]).map(linkDoc =>
                     (linkDoc.GetT(KeyStore.LinkedToDocs, Document)) as Document) : [];
-            let draggedFromDocs = (srcTarg && srcTarg != FieldWaiting) ?
+            let draggedFromDocs = (srcTarg && srcTarg !== FieldWaiting) ?
                 srcTarg.GetList(KeyStore.LinkedFromDocs, [] as Document[]).map(linkDoc =>
                     (linkDoc.GetT(KeyStore.LinkedFromDocs, Document)) as Document) : [];
             draggedDocs.push(...draggedFromDocs);
             if (draggedDocs.length) {
                 let moddrag = [] as Document[];
-                for (let i = 0; i < draggedDocs.length; i++) {
-                    let doc = await draggedDocs[i].GetTAsync(KeyStore.AnnotationOn, Document);
-                    if (doc)
-                        moddrag.push(doc);
+                for (const draggedDoc of draggedDocs) {
+                    let doc = await draggedDoc.GetTAsync(KeyStore.AnnotationOn, Document);
+                    if (doc) moddrag.push(doc);
                 }
                 let dragData = new DragManager.DocumentDragData(moddrag);
                 DragManager.StartDocumentDrag([this._linkButton.current], dragData, {
-- 
cgit v1.2.3-70-g09d2

