diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-04-14 21:44:36 -0400 | 
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-04-14 21:44:36 -0400 | 
| commit | a5ae4d9867ed98e0e3ae52dee47596c62e2f74f7 (patch) | |
| tree | 46bd0ab317c5a61892071071a5ab6889a1a97911 /src/client/util/DocumentManager.ts | |
| parent | 7b7f1fb2865522da414314afbdb09847e7a9409c (diff) | |
| parent | c787b0eac374b4dabf6ede7ee40e77a28815d5c8 (diff) | |
Merge branch 'master' into interaction_changes
Diffstat (limited to 'src/client/util/DocumentManager.ts')
| -rw-r--r-- | src/client/util/DocumentManager.ts | 22 | 
1 files changed, 7 insertions, 15 deletions
| diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index 3e093c8dc..3b5a5b470 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -1,11 +1,9 @@ -import React = require('react'); -import { observer } from 'mobx-react'; -import { observable, action, computed } from 'mobx'; +import { computed, observable } from 'mobx';  import { Document } from "../../fields/Document"; -import { DocumentView } from '../views/nodes/DocumentView'; -import { KeyStore } from '../../fields/KeyStore';  import { FieldWaiting } from '../../fields/Field'; +import { KeyStore } from '../../fields/KeyStore';  import { ListField } from '../../fields/ListField'; +import { DocumentView } from '../views/nodes/DocumentView';  export class DocumentManager { @@ -27,10 +25,6 @@ export class DocumentManager {          // this.DocumentViews = new Array<DocumentView>();      } -    public getAllDocumentViews(collection: Document) { -        return this.DocumentViews.filter(dv => dv.props.ContainingCollectionView && dv.props.ContainingCollectionView.props.Document === collection); -    } -      public getDocumentView(toFind: Document): DocumentView | null {          let toReturn: DocumentView | null; @@ -39,7 +33,6 @@ export class DocumentManager {          //gets document view that is in a freeform canvas collection          DocumentManager.Instance.DocumentViews.map(view => {              let doc = view.props.Document; -            // if (view.props.ContainingCollectionView instanceof CollectionFreeFormView) {              if (doc === toFind) {                  toReturn = view; @@ -51,7 +44,7 @@ export class DocumentManager {              }          }); -        return (toReturn); +        return toReturn;      }      public getDocumentViews(toFind: Document): DocumentView[] { @@ -72,7 +65,7 @@ export class DocumentManager {              }          }); -        return (toReturn); +        return toReturn;      }      @computed @@ -84,9 +77,8 @@ export class DocumentManager {                      if (link instanceof Document) {                          let linkToDoc = link.GetT(KeyStore.LinkedToDocs, Document);                          if (linkToDoc && linkToDoc !== FieldWaiting) { -                            DocumentManager.Instance.getDocumentViews(linkToDoc).map(docView1 => { -                                pairs.push({ a: dv, b: docView1, l: link }); -                            }); +                            DocumentManager.Instance.getDocumentViews(linkToDoc).map(docView1 => +                                pairs.push({ a: dv, b: docView1, l: link }));                          }                      }                      return pairs; | 
