aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-02-07 21:15:37 -0500
committerbobzel <zzzman@gmail.com>2024-02-07 21:15:37 -0500
commit5fa690804ebd0b915488530882564a241315ad09 (patch)
treebf5ecce6c4f2c7028a6fd51ba3a36b7154d75d2f /src/client/util/DocumentManager.ts
parentfda76a08ddf4d47ae8df05b44e6561b4d84546b5 (diff)
changed so link docs are added to common ancestor of anchors so that they can appear above/below intermediary docs using z order. fixed dragging to tab bar to start dragging document as a tab.
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index eada5af75..7407fa2b3 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -209,6 +209,20 @@ export class DocumentManager {
finished?.();
};
+ public static LinkCommonAncestor(linkDoc: Doc) {
+ const anchor = (which: number) => {
+ const anch = DocCast(linkDoc['link_anchor_' + which]);
+ const anchor = anch?.layout_unrendered ? DocCast(anch.annotationOn) : anch;
+ return DocumentManager.Instance.getDocumentView(anchor);
+ };
+ const anchor1 = anchor(1);
+ const anchor2 = anchor(2);
+ return anchor1
+ ?.docViewPath()
+ .reverse()
+ .find(ancestor => anchor2?.docViewPath().includes(ancestor));
+ }
+
// shows a documentView by:
// traverses down through the viewPath of contexts to the view:
// focusing on each context