aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/WebBox.tsx
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2023-03-16 11:16:19 -0400
committergeireann <geireann.lindfield@gmail.com>2023-03-16 11:16:19 -0400
commita0ae93e3b14069c0de419fc5dcade84d460a0b30 (patch)
tree40a3b49fc48975be3797bcb07c96771e32bdc77b /src/client/views/nodes/WebBox.tsx
parentab60751c36cb8cf8f87bbb9e1fe227deb3701121 (diff)
parent0e55893d0f7f2a0aa5098df73d0ece5a7f1a4ddf (diff)
Merge branch 'master' into pres-trail-sophie
Diffstat (limited to 'src/client/views/nodes/WebBox.tsx')
-rw-r--r--src/client/views/nodes/WebBox.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index 4f6fcb11a..e5ef85b5a 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -146,6 +146,9 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
const nativeWidth = NumCast(this.layoutDoc.nativeWidth);
const nativeHeight = (nativeWidth * this.props.PanelHeight()) / this.props.PanelWidth();
if (
+ !this.props.isSelected(true) &&
+ !Doc.IsBrushedDegree(this.rootDoc) &&
+ !this.isAnyChildContentActive() &&
!this.rootDoc.thumbLockout &&
!this.props.dontRegisterView &&
this._iframe &&
@@ -182,6 +185,7 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
});
}
};
+ _thumbTimer: any;
async componentDidMount() {
this.props.setContentView?.(this); // this tells the DocumentView that this WebBox is the "content" of the document. this allows the DocumentView to call WebBox relevant methods to configure the UI (eg, show back/forward buttons)
@@ -198,6 +202,7 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
() => this.props.isSelected(true) || this.isAnyChildContentActive() || Doc.isBrushedHighlightedDegree(this.props.Document),
async selected => {
if (selected) {
+ this._thumbTimer && clearTimeout(this._thumbTimer);
this._webPageHasBeenRendered = true;
} else if (
(!this.props.isContentActive(true) || SnappingManager.GetIsDragging()) && // update thumnail when unselected AND (no child annotation is active OR we've started dragging the document in which case no additional deselect will occur so this is the only chance to update the thumbnail)
@@ -205,7 +210,8 @@ export class WebBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
LightboxView.LightboxDoc !== this.rootDoc
) {
// don't create a thumbnail if entering Lightbox from maximize either, since thumb will be empty.
- this.updateThumb();
+ this._thumbTimer && clearTimeout(this._thumbTimer);
+ this._thumbTimer = setTimeout(this.updateThumb, 2000);
}
},
{ fireImmediately: this.props.isSelected(true) || this.isAnyChildContentActive() || (Doc.isBrushedHighlightedDegreeUnmemoized(this.props.Document) ? true : false) }