From 9ae759a3c612bee4803e3714ef4ff141603a9341 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 3 Feb 2021 16:06:48 -0500 Subject: fixed selecting text in lightbox view. --- src/client/views/MainView.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 1f96a26a4..d72b2b409 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -601,8 +601,17 @@ export class MainView extends React.Component { lightboxFuture: (Opt)[] = []; @computed get lightboxView() { if (this.lightboxHistory.lastElement() !== this.LightboxDoc) this.lightboxHistory.push(this.LightboxDoc); + let downx = 0, downy = 0; return !this.LightboxDoc ? (null) : -
this.LightboxDoc = undefined)} > +
{ downx = e.clientX; downy = e.clientY; }} + onClick={action(e => { + if (Math.abs(downx - e.clientX) < 4 && Math.abs(downy - e.clientY) < 4) { + this.lightboxHistory = []; + this.lightboxFuture = []; + this.LightboxDoc = undefined; + } + })} >
-
+
{ e.stopPropagation(); @@ -643,7 +652,7 @@ export class MainView extends React.Component {
-
+
{ e.stopPropagation(); -- cgit v1.2.3-70-g09d2