Skip to content

Commit

Permalink
only trigger events if there are listeners defined
Browse files Browse the repository at this point in the history
  • Loading branch information
iros committed Apr 23, 2013
1 parent 089be72 commit d167b75
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/d3-chart.js
Expand Up @@ -173,10 +173,13 @@
var events = this._events[name];
var i, ev;

for (i = 0; i < events.length; i++) {
ev = events[i];
ev.callback.apply(ev.context, args);
if (events) {
for (i = 0; i < events.length; i++) {
ev = events[i];
ev.callback.apply(ev.context, args);
}
}

return this;
};

Expand Down

0 comments on commit d167b75

Please sign in to comment.