Permalink
Browse files

Fix for versions of IE that don't support the addEventListener method.

Signed-off-by: spospy <pospisil@gmail.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
  • Loading branch information...
1 parent eb19167 commit f568d96d307739f26c763e23a8a591d1532317ec spospy committed with ideak Mar 28, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 leafclusterer.js
View
@@ -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();
},

0 comments on commit f568d96

Please sign in to comment.