Permalink
Browse files

Fix unhandled exception in IE older than v9.

  • Loading branch information...
1 parent aa653ba commit b7520a51eb8ea18830302fe0049972d4e2b0bb86 @jasondavies jasondavies committed Apr 11, 2011
Showing with 14 additions and 10 deletions.
  1. +4 −2 polymaps.js
  2. +6 −6 polymaps.min.js
  3. +4 −2 src/Map.js
View
@@ -684,8 +684,10 @@ resizer.remove = function(map) {
};
// Note: assumes single window (no frames, iframes, etc.)!
-window.addEventListener("resize", resizer, false);
-window.addEventListener("load", resizer, false);
+if (window.addEventListener) {
+ window.addEventListener("resize", resizer, false);
+ window.addEventListener("load", resizer, false);
+}
// See http://wiki.openstreetmap.org/wiki/Mercator
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -310,8 +310,10 @@ resizer.remove = function(map) {
};
// Note: assumes single window (no frames, iframes, etc.)!
-window.addEventListener("resize", resizer, false);
-window.addEventListener("load", resizer, false);
+if (window.addEventListener) {
+ window.addEventListener("resize", resizer, false);
+ window.addEventListener("load", resizer, false);
+}
// See http://wiki.openstreetmap.org/wiki/Mercator

0 comments on commit b7520a5

Please sign in to comment.