aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-06-26 23:42:15 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-06-26 23:42:15 -0400
commit79ceef22921aadc589319d894449b91bff8124f0 (patch)
tree8b279f614aaa165e336fc0553bb82a8a6c2dde65 /src/client/util/DocumentManager.ts
parent9178f360cbc3de7d836387a38e4e1ce6b7c77710 (diff)
parent79345d459a10de1a610bbeb62b503f05b42c1482 (diff)
merged
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 4a129a125..d0014dbf3 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -32,6 +32,30 @@ export class DocumentManager {
// this.DocumentViews = new Array<DocumentView>();
}
+ //gets all views
+ public getDocumentViewsById(id: string) {
+ let toReturn: DocumentView[] = [];
+ DocumentManager.Instance.DocumentViews.map(view => {
+ if (view.props.Document[Id] === id) {
+ toReturn.push(view);
+ }
+ });
+ if (toReturn.length === 0) {
+ DocumentManager.Instance.DocumentViews.map(view => {
+ let doc = view.props.Document.proto;
+ if (doc && doc[Id]) {
+ if(doc[Id] === id)
+ {toReturn.push(view);}
+ }
+ });
+ }
+ return toReturn;
+ }
+
+ public getAllDocumentViews(doc: Doc){
+ return this.getDocumentViewsById(doc[Id]);
+ }
+
public getDocumentViewById(id: string, preferredCollection?: CollectionView | CollectionPDFView | CollectionVideoView): DocumentView | null {
let toReturn: DocumentView | null = null;