Skip to content

Commit

Permalink
Changed document to element.ownerDocument. This so cropper will work …
Browse files Browse the repository at this point in the history
…within an iframe (fengyuanchen#201)
  • Loading branch information
RnzvNL authored and Chen Fengyuan committed Oct 21, 2017
1 parent f6aff44 commit 1930e2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default {
addListener(cropper, EVENT_DBLCLICK, (this.onDblclick = proxy(this.dblclick, this)));
}

addListener(document, EVENT_POINTER_MOVE, (this.onCropMove = proxy(this.cropMove, this)));
addListener(document, EVENT_POINTER_UP, (this.onCropEnd = proxy(this.cropEnd, this)));
addListener(element.ownerDocument, EVENT_POINTER_MOVE, (this.onCropMove = proxy(this.cropMove, this)));
addListener(element.ownerDocument, EVENT_POINTER_UP, (this.onCropEnd = proxy(this.cropEnd, this)));

if (options.responsive) {
addListener(window, EVENT_RESIZE, (this.onResize = proxy(this.resize, this)));
Expand Down Expand Up @@ -93,8 +93,8 @@ export default {
removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);
}

removeListener(document, EVENT_POINTER_MOVE, this.onCropMove);
removeListener(document, EVENT_POINTER_UP, this.onCropEnd);
removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);
removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);

if (options.responsive) {
removeListener(window, EVENT_RESIZE, this.onResize);
Expand Down

0 comments on commit 1930e2b

Please sign in to comment.