Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix deprecated Selector.matchElements.

  • Loading branch information...
commit 550ec6e053a42a1e4ed610c2cd2c543852120622 1 parent 2ec103d
@tobie tobie authored
Showing with 14 additions and 1 deletion.
  1. +2 −0  CHANGELOG
  2. +12 −1 src/deprecated.js
View
2  CHANGELOG
@@ -1,3 +1,5 @@
+* Fix deprecated Selector.matchElements. (Tobie Langel)
+
* Make Object.keys ES5 compliant. (Tobie Langel)
* Make Prototype's JSON implementation EcmaScript 5 compliant. [#453 state:resolved] (Tobie Langel)
View
13 src/deprecated.js
@@ -241,7 +241,18 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
*
* The only nodes returned will be those that match the given CSS selector.
**/
- matchElements: Prototype.Selector.filter,
+ matchElements: function(elements, expression) {
+ var match = Prototype.Selector.match,
+ results = [];
+
+ for (var i = 0, length = elements.length; i < length; i++) {
+ var element = elements[i];
+ if (match(element, expression)) {
+ results.push(Element.extend(element));
+ }
+ }
+ return results;
+ },
/** deprecated
* Selector.findElement(elements, expression[, index = 0]) -> Element
Please sign in to comment.
Something went wrong with that request. Please try again.