diff options
author | Mario <mario@mariovavti.com> | 2020-01-11 10:30:12 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-01-11 10:30:12 +0000 |
commit | f645c6f3a57bf5f53bbb2bde362b2447f725c977 (patch) | |
tree | 9b37650aad46296c5d98a55969348ebb4ee2d097 /library/cropperjs/src/js/events.js | |
parent | 4c1c6908165e5c4fb1b7238f66764f89faa2301a (diff) | |
download | volse-hubzilla-f645c6f3a57bf5f53bbb2bde362b2447f725c977.tar.gz volse-hubzilla-f645c6f3a57bf5f53bbb2bde362b2447f725c977.tar.bz2 volse-hubzilla-f645c6f3a57bf5f53bbb2bde362b2447f725c977.zip |
update cropperjs to the recent version
Diffstat (limited to 'library/cropperjs/src/js/events.js')
-rw-r--r-- | library/cropperjs/src/js/events.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/library/cropperjs/src/js/events.js b/library/cropperjs/src/js/events.js index 3753db022..e46888704 100644 --- a/library/cropperjs/src/js/events.js +++ b/library/cropperjs/src/js/events.js @@ -14,7 +14,6 @@ import { import { addListener, isFunction, - proxy, removeListener, } from './utilities'; @@ -42,29 +41,32 @@ export default { addListener(element, EVENT_ZOOM, options.zoom); } - addListener(cropper, EVENT_POINTER_DOWN, (this.onCropStart = proxy(this.cropStart, this))); + addListener(cropper, EVENT_POINTER_DOWN, (this.onCropStart = this.cropStart.bind(this))); if (options.zoomable && options.zoomOnWheel) { - addListener(cropper, EVENT_WHEEL, (this.onWheel = proxy(this.wheel, this))); + addListener(cropper, EVENT_WHEEL, (this.onWheel = this.wheel.bind(this)), { + passive: false, + capture: true, + }); } if (options.toggleDragModeOnDblclick) { - addListener(cropper, EVENT_DBLCLICK, (this.onDblclick = proxy(this.dblclick, this))); + addListener(cropper, EVENT_DBLCLICK, (this.onDblclick = this.dblclick.bind(this))); } addListener( element.ownerDocument, EVENT_POINTER_MOVE, - (this.onCropMove = proxy(this.cropMove, this)), + (this.onCropMove = this.cropMove.bind(this)), ); addListener( element.ownerDocument, EVENT_POINTER_UP, - (this.onCropEnd = proxy(this.cropEnd, this)), + (this.onCropEnd = this.cropEnd.bind(this)), ); if (options.responsive) { - addListener(window, EVENT_RESIZE, (this.onResize = proxy(this.resize, this))); + addListener(window, EVENT_RESIZE, (this.onResize = this.resize.bind(this))); } }, @@ -94,7 +96,10 @@ export default { removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart); if (options.zoomable && options.zoomOnWheel) { - removeListener(cropper, EVENT_WHEEL, this.onWheel); + removeListener(cropper, EVENT_WHEEL, this.onWheel, { + passive: false, + capture: true, + }); } if (options.toggleDragModeOnDblclick) { |