]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/application.js
Implement Array.forEach for browsers which don't have it
[rails.git] / app / assets / javascripts / application.js
index e02949f5867f8624bb8d68e63447dc5c6afc45b7..352ec9f8ae2117ac7082efa2b79da801ba9dfe25 100644 (file)
@@ -5,11 +5,20 @@
 //= require openlayers
 //= require i18n/translations
 //= require globals
+//= require compat
 //= require browse
 //= require export
 //= require map
 //= require menu
 
+if ( !Array.prototype.forEach ) {
+  Array.prototype.forEach = function(fn, scope) {
+    for(var i = 0, len = this.length; i < len; ++i) {
+      fn.call(scope || this, this[i], i, this);
+    }
+  }
+}
+
 /*
  * Called as the user scrolls/zooms around to aniplate hrefs of the
  * view tab and various other links