aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking/LinkMenuItem.tsx
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/views/linking/LinkMenuItem.tsx
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/views/linking/LinkMenuItem.tsx')
-rw-r--r--src/client/views/linking/LinkMenuItem.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index 92c63cd56..a44ad26cd 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -9,6 +9,7 @@ import { Doc } from '../../../fields/Doc';
import { Cast, DocCast, StrCast } from '../../../fields/Types';
import { WebField } from '../../../fields/URLField';
import { DocumentType } from '../../documents/DocumentTypes';
+import { DocumentManager } from '../../util/DocumentManager';
import { DragManager } from '../../util/DragManager';
import { LinkFollower } from '../../util/LinkFollower';
import { LinkManager } from '../../util/LinkManager';
@@ -76,8 +77,9 @@ export class LinkMenuItem extends ObservableReactComponent<LinkMenuItemProps> {
onIconDown = (e: React.PointerEvent) => {
setupMoveUpEvents(this, e, returnFalse, returnFalse, () => {
- if (!this._props.docView._props.removeDocument?.(this._props.linkDoc)) {
- this._props.docView._props.addDocument?.(this._props.linkDoc);
+ const ancestor = DocumentManager.LinkCommonAncestor(this._props.linkDoc);
+ if (!ancestor?.ComponentView?.removeDocument?.(this._props.linkDoc)) {
+ ancestor?.ComponentView?.addDocument?.(this._props.linkDoc);
}
});
};