Permalink
Browse files

less useless code

  • Loading branch information...
1 parent 89e823a commit 43c36ac9e6b1137a0b8fc57300e1584deadbb7ac @ralt committed Feb 26, 2013
Showing with 7 additions and 8 deletions.
  1. +2 −2 README.md
  2. +4 −5 lib/delegation.js
  3. +1 −1 package.json
View
@@ -10,9 +10,9 @@ Example
---
```javascript
-var delegation = require('delegation');
+var delegate = require('delegation');
-delegation(document, 'click', 'li', function(e) {
+delegate(document, 'click', 'li', function(e) {
console.log(this.nodeName); // "LI"
});
```
View
@@ -22,13 +22,12 @@ function delegation(parent, evt, selector, fn) {
if (el[matchesSelector](selector)) {
return el;
}
- else {
- if (el.parentNode !== parent) {
- return find(el.parentNode);
- }
- return false;
+ if (el.parentNode !== parent) {
+ return find(el.parentNode);
}
+
+ return false;
}(e.target);
if (elt) {
View
@@ -1,7 +1,7 @@
{
"name": "delegation",
"description": "Implements event delegation.",
- "version": "0.5.0",
+ "version": "0.6.0",
"keywords": [
"client",
"client-side",

0 comments on commit 43c36ac

Please sign in to comment.