Clean-up NWMatcher proxy.

This commit is contained in:
Tobie Langel 2009-10-23 13:17:53 +02:00
parent f6f6955a71
commit 7f5ce1e6c2

View File

@ -8,19 +8,19 @@ delete Prototype._original_nw;
Prototype.Selector = (function(NW) {
function select(selector, scope) {
var results = [];
var results = [], resultsIndex = 0;
NW.select(selector, scope || document, null, function(element) {
results.push(Element.extend(element));
results[resultsIndex++] = Element.extend(element);
});
return results;
}
function filter(elements, selector) {
var results = [], element;
var results = [], resultsIndex = 0, element;
for (var i = 0, length = elements.length; i < length; i++) {
element = elements[i];
if (NW.match(element, selector)) {
results.push(Element.extend(element))
results[resultsIndex++] = Element.extend(element);
}
}
return results;