New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastfix: Original can be undefined #45

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@jbrumwell

jbrumwell commented Aug 17, 2012

Fixes pageX, pageY and which for when the original event does not exist and
the original value is undefined.

I was working with a jquery plugin that invokes mousemove like so

/trigger mousemove to move the knob to the current position
            $(document).on({
                mousemove: $.proxy(this.mousemove, this),
                mouseup: $.proxy(this.mouseup, this)
}).trigger('mousemove');

Since the mousemove handler handles actually mouse movements and this custom event, when calling:

var something = e.pageX || someothervalue;

It causes and error "original is undefined" I have not needed the which event but it most likely suffers from the same issue.

Jason Brumwell
Fastfix: Original can be undefined
Fixes pageX, pageY and which for when the original event does not exist and
the original value is undefined
@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Aug 24, 2012

Contributor

Good point. It seems as if every special mapping should have a

if(!original) {
    return;
}

As relatedTarget already does.

Contributor

daffl commented Aug 24, 2012

Good point. It seems as if every special mapping should have a

if(!original) {
    return;
}

As relatedTarget already does.

@daffl daffl closed this in 34f1c67 Aug 28, 2012

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Aug 28, 2012

Contributor

I fixed it with the snippet I mentioned. Let me know if there are any problems with that.

Contributor

daffl commented Aug 28, 2012

I fixed it with the snippet I mentioned. Let me know if there are any problems with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment