Navigation Menu

Skip to content

Commit

Permalink
Fixes the shim
Browse files Browse the repository at this point in the history
  • Loading branch information
ralt committed Feb 27, 2013
1 parent 3984754 commit 37c76cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions lib/delegation.js
Expand Up @@ -7,14 +7,11 @@ var or = require('or');
module.exports = delegation;

// Shim for matchesSelector
var matchesSelector = function() {
var shims = ['matchesSelector', 'mozMatchesSelector',
'webkitMatchesSelector', 'oMatchesSelector', 'msMatchesSelector'];

return or(shims, function(shim) {
return shim in document;
});
}();
var matchesSelector = or(['matchesSelector', 'mozMatchesSelector',
'webkitMatchesSelector', 'oMatchesSelector',
'msMatchesSelector'], function(shim) {
return shim in document.documentElement;
});

function delegation(parent, evt, selector, fn) {
parent.addEventListener(evt, function(e) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "delegation",
"description": "Implements event delegation.",
"version": "0.7.0",
"version": "0.8.0",
"dependencies": {
"or": "0.x"
},
Expand Down

0 comments on commit 37c76cf

Please sign in to comment.