Skip to content

Commit

Permalink
Fix Element extension when using the NWMatcher selector engine. (jdda…
Browse files Browse the repository at this point in the history
…lton)
  • Loading branch information
tobie committed Oct 23, 2009
1 parent 15c323b commit ed27b22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -102,7 +102,7 @@ module PrototypeHelper
end

def self.require_nwmatcher
if !File.exists?(File.join(ROOT_DIR, 'vendor', 'nwmatcher', 'src', 'nwmatcher.js'))
if !File.exists?(File.join(ROOT_DIR, 'vendor', 'nwmatcher', 'nwmatcher', 'src', 'nwmatcher.js'))
exit unless get_submodule("NWMmatcher", "nwmatcher/nwmatcher")
end
end
Expand Down
6 changes: 5 additions & 1 deletion vendor/nwmatcher/selector_engine.js
Expand Up @@ -8,7 +8,11 @@ delete Prototype._original_nw;

Prototype.Selector = (function(NW) {
function select(selector, scope) {
return NW.select(selector, scope || document, null, Element.extend);
var results = [];
NW.select(selector, scope || document, null, function(element) {
results.push(Element.extend(element));
});
return results;
}

function filter(elements, selector) {
Expand Down

0 comments on commit ed27b22

Please sign in to comment.