aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 5ae292760..4ab2e8d05 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -45,6 +45,7 @@ export class DocumentManager {
DocumentView.addViewRenderedCb = this.AddViewRenderedCb;
DocumentView.getFirstDocumentView = this.getFirstDocumentView;
DocumentView.getDocumentView = this.getDocumentView;
+ DocumentView.getDocViewIndex = this.getDocViewIndex;
DocumentView.getContextPath = DocumentManager.GetContextPath;
DocumentView.getLightboxDocumentView = this.getLightboxDocumentView;
observe(Doc.CurrentlyLoading, change => {
@@ -140,6 +141,10 @@ export class DocumentManager {
);
}
+ public getDocViewIndex(target: Doc): number {
+ return DocumentManager.Instance.DocumentViews.findIndex(dv => dv.Document === target);
+ }
+
public getLightboxDocumentView = (toFind: Doc): DocumentView | undefined => {
const views: DocumentView[] = [];
DocumentManager.Instance.DocumentViews.forEach(view => DocumentView.LightboxContains(view) && Doc.AreProtosEqual(view.Document, toFind) && views.push(view));