Higher level dom event delegation management
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
component.json
example.html
index.js

Readme.md

delegates

Higher level dom event delegation management based on EventManager.

Installation

$ component install component/delegates

Example

var delegates = require('delegates');
var el = document.querySelector('ul');

var view = new ListView(el);

function ListView(el) {
  this.events = delegates(el, this);
  this.events.bind('click li', 'remove');
}

ListView.prototype.remove = function(e){
  var el = e.target;
  console.log('remove %s', el.textContent);
  el.parentNode.removeChild(el);
};

API

See component/event-manager.

License

MIT