From 9787801f0619f4ac67e48ed632956e9957baad9e Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Thu, 24 Apr 2008 14:00:03 -0500 Subject: [PATCH] Fix an issue with calling Event.pointer before the DOM is loaded. (kangax, jddalton) [#4 state:resolved] --- CHANGELOG | 2 ++ src/event.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 22877e3..60c8b56 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Fix an issue with calling Event.pointer before the DOM is loaded. (kangax, jddalton) [#4 state:resolved] + * Element#down on an input element should not raise error. (humeniuc, kangax) * More unit tests for Object.isHash. (Tobie Langel) diff --git a/src/event.js b/src/event.js index 4e87a2b..7f7f527 100644 --- a/src/event.js +++ b/src/event.js @@ -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) -