aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-09-13 10:31:20 -0400
committerbobzel <zzzman@gmail.com>2023-09-13 10:31:20 -0400
commit6536508867969f8e9d191d0fd9e4dd0f43606bc0 (patch)
tree076ea98f6fe7633e8f2d23f3f497fb74891e3262
parent087058437c7eedd01c0f8a84a29aa612d133049f (diff)
need to honor 'addAsAnnotation' flag getting anchors so that docs know when they are a target of config.
-rw-r--r--src/client/views/DocumentButtonBar.tsx2
-rw-r--r--src/client/views/nodes/ImageBox.tsx2
-rw-r--r--src/client/views/nodes/PDFBox.tsx2
-rw-r--r--src/client/views/nodes/WebBox.tsx2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 345135a1a..c1ec5b4a4 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -562,7 +562,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
const rootView = this.props.views()[0];
const rootDoc = rootView?.rootDoc;
if (rootDoc) {
- const anchor = rootView.ComponentView?.getAnchor?.(false) ?? rootDoc;
+ const anchor = rootView.ComponentView?.getAnchor?.(true) ?? rootDoc;
const trail = DocCast(anchor.presentationTrail) ?? Doc.MakeCopy(DocCast(Doc.UserDoc().emptyTrail), true);
if (trail !== anchor.presentationTrail) {
DocUtils.MakeLink(anchor, trail, { link_relationship: 'link trail' });
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index d2508e7cf..1ab120af5 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -97,7 +97,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp
});
if (anchor) {
if (!addAsAnnotation) anchor.backgroundColor = 'transparent';
- addAsAnnotation && visibleAnchor && this.addDocument(anchor);
+ addAsAnnotation && this.addDocument(anchor);
PresBox.pinDocView(anchor, { pinDocLayout: pinProps?.pinDocLayout, pinData: { ...(pinProps?.pinData ?? {}), pannable: visibleAnchor ? false : true } }, this.rootDoc);
return anchor;
}
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index 5cec8fc24..39e27d15b 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -248,7 +248,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
PresBox.pinDocView(anchor, { pinDocLayout: pinProps?.pinDocLayout, pinData: { ...(pinProps?.pinData ?? {}), scrollable: true, pannable: true } }, this.rootDoc);
anchor.text = ele?.textContent ?? '';
anchor.text_html = ele?.innerHTML;
- addAsAnnotation && visibleAnchor && this.addDocument(anchor);
+ addAsAnnotation && this.addDocument(anchor);
return anchor;
};
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index d5b7b5dfe..27c19105f 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -341,7 +341,7 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
PresBox.pinDocView(anchor, { pinDocLayout: pinProps?.pinDocLayout, pinData: { ...(pinProps?.pinData ?? {}), scrollable: pinProps?.pinData ? true : false, pannable: true } }, this.rootDoc);
anchor.text = ele?.textContent ?? '';
anchor.text_html = ele?.innerHTML;
- addAsAnnotation && visibleAnchor && this.addDocumentWrapper(anchor);
+ addAsAnnotation && this.addDocumentWrapper(anchor);
return anchor;
};