Skip to content

Commit

Permalink
Fix an issue with calling Event.pointer before the DOM is loaded. (ka…
Browse files Browse the repository at this point in the history
…ngax, jddalton) [#4 state:resolved]

(cherry picked from commit af704e7b2280eb4a9ef26a54662427bfc11cb729)
  • Loading branch information
savetheclocktower committed Apr 24, 2008
1 parent 5202fc3 commit 92c32e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1,3 +1,5 @@
* Fix an issue with calling Event.pointer before the DOM is loaded. (kangax, jddalton) [#4 state:resolved]

* Refactor unit tests. Unit tests are now dynamically generated from a JavaScript test file and optional HTML, JS and CSS fixtures. [Tobie Langel]

* Switch to a different strategy for event handler garbage collection. Store references to elements instead of searching the entire document. (jddalton, kangax, Andrew Dupont)
Expand Down
3 changes: 2 additions & 1 deletion src/event.js
Expand Up @@ -86,7 +86,8 @@ Event.Methods = (function() {
},

pointer: function(event) {
var docElement = document.documentElement, body = document.body;
var docElement = document.documentElement,
body = document.body || { scrollLeft: 0, scrollTop: 0 };
return {
x: event.pageX || (event.clientX +
(docElement.scrollLeft || body.scrollLeft) -
Expand Down

0 comments on commit 92c32e7

Please sign in to comment.