From aada1abb5678ed0201e9d22c9f7737ef69db85f5 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Tue, 16 Oct 2007 05:11:42 +0000 Subject: [PATCH] * Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont] --- CHANGELOG | 2 ++ src/event.js | 3 ++- test/functional/event.html | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 59548a1..ec6d0c8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont] + * Don't translate "keypress" events into "keydown" events. [sam] Note: "keypress" is broken in Safari <= 2.x, but Event#stop has no effect on "keydown" events. diff --git a/src/event.js b/src/event.js index e6ff428..6c7ce63 100644 --- a/src/event.js +++ b/src/event.js @@ -56,7 +56,7 @@ Event.Methods = (function() { isRightClick: function(event) { return isButton(event, 2) }, element: function(event) { - var node = event.target; + var node = Event.extend(event).target; return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node); }, @@ -78,6 +78,7 @@ Event.Methods = (function() { pointerY: function(event) { return Event.pointer(event).y }, stop: function(event) { + Event.extend(event); event.preventDefault(); event.stopPropagation(); } diff --git a/test/functional/event.html b/test/functional/event.html index d0dfc37..378b2fb 100644 --- a/test/functional/event.html +++ b/test/functional/event.html @@ -58,6 +58,8 @@

A basic event test - click here

click to stop observing the first test

+

click to ensure generic Event methods work on inline handlers

+