diff --git a/dev/raphael.core.js b/dev/raphael.core.js index c25f69d6..b3cfbefb 100644 --- a/dev/raphael.core.js +++ b/dev/raphael.core.js @@ -2705,8 +2705,8 @@ return this.originalEvent.stopPropagation(); }, getEventPosition = function (e) { - var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft; + var scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft; return { x: e.clientX + scrollX, @@ -2755,8 +2755,8 @@ return function (obj, type, fn, element) { var f = function (e) { e = e || g.win.event; - var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, + var scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft, x = e.clientX + scrollX, y = e.clientY + scrollY; e.preventDefault = e.preventDefault || preventDefault; @@ -2776,8 +2776,8 @@ dragMove = function (e) { var x = e.clientX, y = e.clientY, - scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, + scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft, dragi, j = drag.length; while (j--) { @@ -3207,8 +3207,8 @@ (e.originalEvent || e).preventDefault(); var x = e.clientX, y = e.clientY, - scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft; + scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft; this._drag.id = e.identifier; if (supportsTouch && e.touches) { var i = e.touches.length, touch; diff --git a/raphael.js b/raphael.js index 95f6364f..0e3b3faa 100644 --- a/raphael.js +++ b/raphael.js @@ -3084,8 +3084,8 @@ return this.originalEvent.stopPropagation(); }, getEventPosition = function (e) { - var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft; + var scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft; return { x: e.clientX + scrollX, @@ -3134,8 +3134,8 @@ return function (obj, type, fn, element) { var f = function (e) { e = e || g.win.event; - var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, + var scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft, x = e.clientX + scrollX, y = e.clientY + scrollY; e.preventDefault = e.preventDefault || preventDefault; @@ -3155,8 +3155,8 @@ dragMove = function (e) { var x = e.clientX, y = e.clientY, - scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft, + scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft, dragi, j = drag.length; while (j--) { @@ -3586,8 +3586,8 @@ (e.originalEvent || e).preventDefault(); var x = e.clientX, y = e.clientY, - scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop, - scrollX = g.doc.documentElement.scrollLeft || g.doc.body.scrollLeft; + scrollY = typeof g.doc.documentElement.scrollTop === 'number' ? g.doc.documentElement.scrollTop : g.doc.body.scrollTop, + scrollX = typeof g.doc.documentElement.scrollLeft === 'number' ? g.doc.documentElement.scrollLeft : g.doc.body.scrollLeft; this._drag.id = e.identifier; if (supportsTouch && e.touches) { var i = e.touches.length, touch;