Fix for event fix: Don't overwrite event.target if there is no srcElement; calculate pageX/Y (tested with tooltip plugin)
This commit is contained in:
parent
c136717119
commit
d98283a3a3
9
src/jquery/jquery.js
vendored
9
src/jquery/jquery.js
vendored
|
@ -1959,9 +1959,16 @@ jQuery.extend({
|
||||||
fix: function(event) {
|
fix: function(event) {
|
||||||
// check IE
|
// check IE
|
||||||
if(jQuery.browser.msie) {
|
if(jQuery.browser.msie) {
|
||||||
// fix target property
|
// fix target property, if available
|
||||||
|
// check prevents overwriting of fake target coming from trigger
|
||||||
|
if(event.srcElement)
|
||||||
event.target = event.srcElement;
|
event.target = event.srcElement;
|
||||||
|
|
||||||
|
// calculate pageX/Y
|
||||||
|
var e = document.documentElement, b = document.body;
|
||||||
|
event.pageX = event.clientX + (e.scrollLeft || b.scrollLeft);
|
||||||
|
event.pageY = event.clientY + (e.scrollTop || b.scrollTop);
|
||||||
|
|
||||||
// check safari and if target is a textnode
|
// check safari and if target is a textnode
|
||||||
} else if(jQuery.browser.safari && event.target.nodeType == 3) {
|
} else if(jQuery.browser.safari && event.target.nodeType == 3) {
|
||||||
// target is readonly, clone the event object
|
// target is readonly, clone the event object
|
||||||
|
|
Loading…
Reference in a new issue