aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/DocumentManager.ts10
-rw-r--r--src/client/util/DragManager.ts2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 6076de055..1d603e18f 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -169,10 +169,12 @@ export class DocumentManager {
const getFirstDocView = LightboxView.LightboxDoc ? DocumentManager.Instance.getLightboxDocumentView : DocumentManager.Instance.getFirstDocumentView;
const docView = getFirstDocView(targetDoc, originatingDoc);
const wasHidden = targetDoc.hidden; //
- if (wasHidden) runInAction(() => {
- targetDoc.hidden = false;
- docView?.props.bringToFront(targetDoc);
- }); // if the target is hidden, un-hide it here.
+ if (wasHidden) {
+ runInAction(() => {
+ targetDoc.hidden = false;
+ docView?.props.bringToFront(targetDoc);
+ }); // if the target is hidden, un-hide it here.
+ }
const focusAndFinish = (didFocus: boolean) => {
if (originatingDoc?.isPushpin) {
if (!didFocus && !wasHidden) { // don't toggle the hidden state if the doc was already un-hidden as part of this document traversal
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index 94a09eac4..13e5940d6 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -405,7 +405,7 @@ export namespace DragManager {
Array.from(pdfBox).filter(pb => pb.width && pb.height).map((pb, i) => pb.getContext('2d')!.drawImage(pdfBoxSrc[i], 0, 0));
}
[dragElement, ...Array.from(dragElement.getElementsByTagName('*'))].forEach(ele =>
- ele.hasAttribute("style") && ((ele as any).style.pointerEvents = "none"));
+ (ele as any).style && ((ele as any).style.pointerEvents = "none"));
dragDiv.appendChild(dragElement);
if (dragElement !== ele) {