Skip to content

Commit

Permalink
Support space separated event names in delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Morgan committed Nov 20, 2014
1 parent 2728c85 commit b1657bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions www/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
* @return void
*/
delegate: function(target, ev, callback) {
var events = ev.split(' ');
var i;
if(events.length > 1) {
for(i in events) {
DOMTools.delegate(target, events[i], callback);
}
return;
}
document.addEventListener(
ev,
DOMTools._delegateListener(
Expand Down

0 comments on commit b1657bf

Please sign in to comment.