prototype: Event.findElement behaves as expected when the element passed matches the given selector. Closes #8395.

This commit is contained in:
Sam Stephenson 2007-05-24 07:13:55 +00:00
parent f099e670f5
commit b61bca10da
2 changed files with 4 additions and 1 deletions

View File

@ -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]

View File

@ -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,