From b61bca10da14c918f0dc4cbde04d272a292f55a9 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Thu, 24 May 2007 07:13:55 +0000 Subject: [PATCH] prototype: Event.findElement behaves as expected when the element passed matches the given selector. Closes #8395. --- CHANGELOG | 2 ++ src/event.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index a869c4b..fe6572d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Event.findElement behaves as expected when the element passed matches the given selector. Closes #8395. [Mislav Marohnić, Tobie Langel] + * Element.setOpacity now calls removeAttribute on the filter style on IE if no more filters remain, which makes Cleartype work properly. Closes #8376. [alexdemi, Thomas Fuchs] * Event.findElement now uses Element#up (and as a result can take a CSS selector instead of just a tag name). [Tobie Langel] diff --git a/src/event.js b/src/event.js index 499a239..e1a3ea9 100644 --- a/src/event.js +++ b/src/event.js @@ -47,7 +47,8 @@ Object.extend(Event, { }, findElement: function(event, expression) { - return Event.element(event).up(expression); + var element = Event.element(event); + return element.match(expression) ? element : element.up(expression); }, observers: false,