From 1395ce3fbf73bf5df5ed4add744c333cfc8008c9 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 15 Sep 2021 15:43:24 -0400 Subject: another windows fix for contextmenus on web pages --- src/client/views/MainView.tsx | 1 + src/client/views/nodes/WebBox.tsx | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 5bda9f6bf..d854f118f 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -214,6 +214,7 @@ export class MainView extends React.Component { } } }, false); + document.oncontextmenu = () => false; } initAuthenticationRouters = async () => { diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index fe5070fa4..cce71329d 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -224,15 +224,20 @@ export class WebBox extends ViewBoxAnnotatableComponent - {this.inlineTextAnnotations.sort((a, b) => NumCast(a.y) - NumCast(b.y)).map(anno => - ) - } - ; + return !this.inlineTextAnnotations.length ? (null) : +
+ {this.inlineTextAnnotations.sort((a, b) => NumCast(a.y) - NumCast(b.y)).map(anno => + ) + } +
; } @observable _showSidebar = false; -- cgit v1.2.3-70-g09d2