aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-06-04 09:06:33 -0400
committerbob <bcz@cs.brown.edu>2019-06-04 09:06:33 -0400
commiteccf79cb6e7abe2dd0555054e57d5037465c0bd2 (patch)
treea32c1169670c0d1daead2714eb703a62d55f82c1
parent8edac25c7e39ba660d3d2b76f38d579a61e5d016 (diff)
fix for stackingview with zoombasis. fix for text box links w/ styles
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx2
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx9
2 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index ea3c144f2..acd585268 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -32,7 +32,7 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
let nh = NumCast(d.nativeHeight);
if (nw && nh) hgt = nh / nw * Math.min(this.columnWidth, wid);
return height + hgt + 2 * this.gridGap;
- }, this.gridGap * 2);
+ }, this.gridGap * 2) * NumCast(this.props.Document.zoomBasis, 1);
}
}, { fireImmediately: true });
}
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 3b61c68dd..5c635cc0c 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -231,9 +231,12 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
}
}
let ctrlKey = e.ctrlKey;
- if (e.button === 0 && ((!this.props.isSelected() && !e.ctrlKey) || (this.props.isSelected() && e.ctrlKey)) && !e.metaKey) {
- if (e.target && (e.target as any).href) {
- let href = (e.target as any).href;
+ if (e.button === 0 && ((!this.props.isSelected() && !e.ctrlKey) || (this.props.isSelected() && e.ctrlKey)) && !e.metaKey && e.target) {
+ let href = (e.target as any).href;
+ for (let parent = (e.target as any).parentNode; !href && parent; parent = parent.parentNode) {
+ href = parent.childNodes[0].href;
+ }
+ if (href) {
if (href.indexOf(DocServer.prepend("/doc/")) === 0) {
let docid = href.replace(DocServer.prepend("/doc/"), "").split("?")[0];
DocServer.GetRefField(docid).then(f => {