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) -