Permalink
Browse files

Added foreach shim

  • Loading branch information...
1 parent 72a30e2 commit 5b5a48dcfdf34efb175946084c758a74e7604857 myfreeweb committed Feb 20, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 views/js.haml
View
@@ -1,6 +1,9 @@
- if flash
%script{:type => "text/javascript", :src => "/$dom.js"}
:javascript
+ if (!Array.prototype.forEach) {Array.prototype.forEach = function(fun){var len=this.length;
+ if (typeof fun!="function") throw new TypeError();
+ var thisp = arguments[1];for (var i = 0; i < len; i++){if (i in this)fun.call(thisp, this[i], i, this);}}}
var el = $dom.get('.flash');
setTimeout(function() {
if (Modernizr.csstransitions) el.forEach(function(e){$dom.addClass(e,'fade')})

0 comments on commit 5b5a48d

Please sign in to comment.