Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/delegates
Higher level dom event delegation management
https://github.com/component/delegates
Last synced: 13 days ago
JSON representation
Higher level dom event delegation management
- Host: GitHub
- URL: https://github.com/component/delegates
- Owner: component
- Created: 2012-12-19T16:49:16.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-09T21:48:28.000Z (about 11 years ago)
- Last Synced: 2024-05-08T17:12:25.145Z (8 months ago)
- Language: JavaScript
- Size: 116 KB
- Stars: 4
- Watchers: 5
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# delegates
Higher level dom event delegation management based on [EventManager](https://github.com/component/event-manager).
## Installation
$ component install component/delegates
## Example
```js
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](https://github.com/component/event-manager).
## License
MIT