Skip to content

Commit bc48c7b

Browse files
author
Victor Homyakov
committed
Removed Element.extend from _element accordingly to comment "use it internally as _element without having to extend the node".
Restored `selector.match` in `findElement` because it may rely on `this`. Fixed typo in "IE-proprietarty".
1 parent ecacc02 commit bc48c7b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/prototype/dom/event.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,7 @@
244244

245245
// Fix a Safari bug where a text node gets passed as the target of an
246246
// anchor click rather than the anchor itself.
247-
if (node.nodeType == Node.TEXT_NODE)
248-
node = node.parentNode;
249-
250-
return Element.extend(node);
247+
return node.nodeType == Node.TEXT_NODE ? node.parentNode : node;
251248
}
252249

253250
/**
@@ -275,10 +272,10 @@
275272
* });
276273
**/
277274
function findElement(event, expression) {
278-
var element = _element(event), match = Prototype.Selector.match;
275+
var element = _element(event), selector = Prototype.Selector;
279276
if (!expression) return Element.extend(element);
280277
while (element) {
281-
if (Object.isElement(element) && match(element, expression))
278+
if (Object.isElement(element) && selector.match(element, expression))
282279
return Element.extend(element);
283280
element = element.parentNode;
284281
}

0 commit comments

Comments
 (0)