prototype: Event.findElement now uses Element#up (and as a result can take a CSS selector instead of just a tag name).
This commit is contained in:
parent
a8a19eb439
commit
55b658ac57
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Event.findElement now uses Element#up (and as a result can take a CSS selector instead of just a tag name). [Tobie Langel]
|
||||
|
||||
* Minor cleanup of the position methods [sam]
|
||||
|
||||
* Fix Element#clonePosition to call viewportOffset. Closes #8372. [graemenelson, Christophe Porteneuve]
|
||||
|
|
10
src/event.js
10
src/event.js
|
@ -46,14 +46,8 @@ Object.extend(Event, {
|
|||
}
|
||||
},
|
||||
|
||||
// find the first node with the given tagName, starting from the
|
||||
// node the event was triggered on; traverses the DOM upwards
|
||||
findElement: function(event, tagName) {
|
||||
var element = Event.element(event);
|
||||
while (element.parentNode && (!element.tagName ||
|
||||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
|
||||
element = element.parentNode;
|
||||
return element;
|
||||
findElement: function(event, expression) {
|
||||
return Event.element(event).up(expression);
|
||||
},
|
||||
|
||||
observers: false,
|
||||
|
|
Loading…
Reference in New Issue