Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for IE events #3

Closed
wants to merge 1 commit into from

2 participants

@spospy

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

spospy modified: leafclusterer.js
	Fix for versions of IE that don't support the addEventListener method.
3c91f06
@ideak
Owner

It's merged now, thanks!

@ideak ideak closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 28, 2012
  1. modified: leafclusterer.js

    spospy authored
    	Fix for versions of IE that don't support the addEventListener method.
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 5 deletions.
  1. +13 −5 leafclusterer.js
View
18 leafclusterer.js
@@ -636,12 +636,20 @@ ClusterMarker_ = L.Class.extend({
map.getPanes().overlayPane.appendChild(this.container_);
var cluster = this;
- this.container_.addEventListener(
- "click",
- function() {
+ if (this.container_.addEventListener) {
+ this.container_.addEventListener(
+ "click",
+ function() {
cluster.onClick_(cluster);
- },
- false);
+ },
+ false);
+ } else if (this.container_.attachEvent) {
+ this.container_.attachEvent(
+ "onclick",
+ function() {
+ cluster.onClick_(cluster);
+ });
+ }
map.on('viewreset', this.redraw, this);
this.redraw();
},
Something went wrong with that request. Please try again.