aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ImageBox.tsx
diff options
context:
space:
mode:
authorandrewdkim <adkim414@gmail.com>2019-06-20 11:09:03 -0400
committerandrewdkim <adkim414@gmail.com>2019-06-20 11:09:03 -0400
commitb856d4c0be0b08bf154d552226457b82d31cf81c (patch)
treefbcf2ac0ebe6ea358bada7efb5689f92bf3d2bc9 /src/client/views/nodes/ImageBox.tsx
parentda2157616ca4e614dacbf26fb5fa6758b51a209e (diff)
parenta5478b2d4cc3b66c6b58471cbb05c623d0109724 (diff)
merge with master
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r--src/client/views/nodes/ImageBox.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 0d19508fa..f56a2d926 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -86,9 +86,9 @@ export class ImageBox extends DocComponent<FieldViewProps, ImageDocument>(ImageD
}
onPointerDown = (e: React.PointerEvent): void => {
- if (e.shiftKey && e.ctrlKey)
-
- e.stopPropagation();
+ if (e.shiftKey && e.ctrlKey) {
+ e.stopPropagation(); // allows default system drag drop of images with shift+ctrl only
+ } else e.preventDefault();
// if (Date.now() - this._lastTap < 300) {
// if (e.buttons === 1) {
// this._downX = e.clientX;
@@ -188,8 +188,9 @@ export class ImageBox extends DocComponent<FieldViewProps, ImageDocument>(ImageD
}
@action onError = () => {
let timeout = this._curSuffix === "_s" ? this._smallRetryCount : this._curSuffix === "_m" ? this._mediumRetryCount : this._largeRetryCount;
- if (timeout < 10)
+ if (timeout < 10) {
setTimeout(this.retryPath, Math.min(10000, timeout * 5));
+ }
}
_curSuffix = "_m";
render() {
@@ -217,7 +218,7 @@ export class ImageBox extends DocComponent<FieldViewProps, ImageDocument>(ImageD
let aspect = (rotation % 180) ? this.props.Document[HeightSym]() / this.props.Document[WidthSym]() : 1;
let shift = (rotation % 180) ? (nativeHeight - nativeWidth / aspect) / 2 : 0;
return (
- <div id={id} className={`imageBox-cont${interactive}`}
+ <div id={id} className={`imageBox-cont${interactive}`} style={{ background: "transparent" }}
onPointerDown={this.onPointerDown}
onDrop={this.onDrop} ref={this.createDropTarget} onContextMenu={this.specificContextMenu}>
<img id={id}