Skip to content

Commit

Permalink
Fix for versions of IE that don't support the addEventListener method.
Browse files Browse the repository at this point in the history
Signed-off-by: spospy <pospisil@gmail.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
  • Loading branch information
spospy authored and ideak committed Mar 30, 2012
1 parent eb19167 commit f568d96
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions leafclusterer.js
Expand Up @@ -636,12 +636,17 @@ ClusterMarker_ = L.Class.extend({
map.getPanes().overlayPane.appendChild(this.container_);
var cluster = this;

this.container_.addEventListener(
"click",
function() {
cluster.onClick_(cluster);
},
false);
if (this.container_.addEventListener) {
this.container_.addEventListener("click",
function() {
cluster.onClick_(cluster);
}, false);
} else if (this.container_.attachEvent) {
this.container_.attachEvent("onclick",
function() {
cluster.onClick_(cluster);
});
}
map.on('viewreset', this.redraw, this);
this.redraw();
},
Expand Down

0 comments on commit f568d96

Please sign in to comment.