This repository has been archived by the owner on Aug 1, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For what ever reason, IE=<10 did not provide it's events with
pageX
andpageY
values. 'Cause of this. This plugin did not work in IE=<10.This PR fixes this. It will first try to use
event.originalEvent
, but fall back onevent
if required.This is what I did to come to this conclusion:
I found a real computer with real IE10.
I ran your demo (http://fengyuanchen.github.io/cropper/). It did not work.
Then I cloned your repo, created an index.html page and added this:
Next I tried it with jQuery v1.9.1, v1.11.3 and v2.1.4. It did not work.
Then I hopped into the debugger to see what was going on.
This is the stack for onDragStart. As you can see,
startX
andstartY
isundefined
, 'causee
has nopageX
andpageY
.Next I changed
e.pageX
tooriginalEvent.pageX
ande.pageY
tooriginalEvent.pageY
and added a breakpoint on the same line.Now everything worked.
this
has itsstartX
andstartY
values set.I don't know why this happens and why
e
does not have it'spageX
andpageY
properties set.I was wondering if IE is using its global
event
object and not the argument passed to the function here:anyways... by using the original event, I can get this to work.