]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/media/js/osqa.main.js
fixes OSQA-439. IE should work again. Sorry about that. Thanks for the patches...
[osqa.git] / forum / skins / default / media / js / osqa.main.js
index 92d0aae92a6b86753f468af2e827ef136e2012d9..79cda45e948d52adfeb4620fb8a2424cc9e782cd 100644 (file)
@@ -1076,4 +1076,23 @@ function yourWorkWillBeLost(e) {
 \r
 function browserTester(browserString) {\r
     return navigator.userAgent.toLowerCase().indexOf(browserString) > -1;\r
+}\r
+\r
+// Add missing IE functionality\r
+if (!window.addEventListener) {\r
+    if (window.attachEvent) {\r
+        window.addEventListener = function (type, listener, useCapture) {\r
+            window.attachEvent('on' + type, listener);\r
+        };\r
+        window.removeEventListener = function (type, listener, useCapture) {\r
+            window.detachEvent('on' + type, listener);\r
+        };\r
+    } else {\r
+        window.addEventListener = function (type, listener, useCapture) {\r
+            window['on' + type] = listener;\r
+        };\r
+        window.removeEventListener = function (type, listener, useCapture) {\r
+            window['on' + type] = null;\r
+        };\r
+    }\r
 }
\ No newline at end of file