aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2019-04-22 11:54:45 -0400
committerbobzel <zzzman@gmail.com>2019-04-22 11:54:45 -0400
commit92c3bd4102e40f2f4bfd93e10d0a4a57316614c1 (patch)
treec80bcaf59e9cac6d04185ca8e505fe7eb64da193 /src/client/views/DocumentDecorations.tsx
parentd8bbce0a71951472449c6e87720fb0a21a341b83 (diff)
better fix
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 7d9166c86..d704b6c47 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -26,6 +26,7 @@ export const Flyout = higflyout.default;
export class DocumentDecorations extends React.Component<{}, { value: string }> {
static Instance: DocumentDecorations;
private _isPointerDown = false;
+ private _resizing = "";
private keyinput: React.RefObject<HTMLInputElement>;
private _documents: DocumentView[] = SelectionManager.SelectedDocuments();
private _resizeBorderWidth = 16;
@@ -44,8 +45,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
@observable private _opacity = 1;
@observable private _dragging = false;
@observable private _iconifying = false;
-
- @observable public Resizing = "";
+ @observable public Interacting = false;
constructor(props: Readonly<{}>) {
@@ -141,12 +141,12 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
dragData.yOffset = e.y - top;
let move = SelectionManager.SelectedDocuments()[0].props.moveDocument;
dragData.moveDocument = move;
- this._dragging = true;
+ this.Interacting = this._dragging = true;
document.removeEventListener("pointermove", this.onBackgroundMove);
document.removeEventListener("pointerup", this.onBackgroundUp);
DragManager.StartDocumentDrag(SelectionManager.SelectedDocuments().map(docView => docView.ContentDiv!), dragData, e.x, e.y, {
handlers: {
- dragComplete: action(() => this._dragging = false),
+ dragComplete: action(() => this.Interacting = this._dragging = false),
},
hideSource: true
});
@@ -261,7 +261,8 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
e.stopPropagation();
if (e.button === 0) {
this._isPointerDown = true;
- this.Resizing = e.currentTarget.id;
+ this._resizing = e.currentTarget.id;
+ this.Interacting = true;
document.removeEventListener("pointermove", this.onPointerMove);
document.addEventListener("pointermove", this.onPointerMove);
document.removeEventListener("pointerup", this.onPointerUp);
@@ -330,7 +331,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
let dX = 0, dY = 0, dW = 0, dH = 0;
- switch (this.Resizing) {
+ switch (this._resizing) {
case "":
break;
case "documentDecorations-topLeftResizer":
@@ -403,7 +404,8 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
@action
onPointerUp = (e: PointerEvent): void => {
e.stopPropagation();
- this.Resizing = "";
+ this._resizing = "";
+ this.Interacting = false;
if (e.button === 0) {
e.preventDefault();
this._isPointerDown = false;