Skip to content

Commit

Permalink
Fix scroll events for Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondavies committed Feb 16, 2011
1 parent 77a061f commit 67f122b
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 55 deletions.
7 changes: 5 additions & 2 deletions d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -1450,9 +1450,8 @@ function d3_selection(groups) {

// TODO namespaced event listeners to allow multiples
groups.on = function(type, listener) {
type = "on" + type;
return groups.each(function(d, i) {
this[type] = function(e) {
var l = function(e) {
var o = d3.event; // Events can be reentrant (e.g., focus).
d3.event = e;
try {
Expand All @@ -1461,6 +1460,10 @@ function d3_selection(groups) {
d3.event = o;
}
};
if (this.addEventListener)
this.addEventListener(type, l, false);
else
this["on" + type] = l;
});
};

Expand Down
Loading

0 comments on commit 67f122b

Please sign in to comment.