Permalink
Browse files

updated for latest elements

renamed each -> forEach
  • Loading branch information...
1 parent 40550df commit 1a547e83914efba6cf685380ddc8fa9eee226183 @kamicane committed Nov 3, 2012
Showing with 14 additions and 12 deletions.
  1. +14 −12 lib/browser.js
View
@@ -19,7 +19,7 @@ var camelize = string.camelize,
capitalize = string.capitalize
var map = array.map,
- each = array.forEach,
+ forEach = array.forEach,
indexOf = array.indexOf
var elements = require("elements/lib/elements")
@@ -230,9 +230,9 @@ var setter = function(key){
var trbl = ["Top", "Right", "Bottom", "Left"], tlbl = ["TopLeft", "TopRight", "BottomRight", "BottomLeft"]
-each(trbl, function(d){
+forEach(trbl, function(d){
var bd = "border" + d
- each([ "margin" + d, "padding" + d, bd + "Width", d.toLowerCase()], function(n){
+ forEach([ "margin" + d, "padding" + d, bd + "Width", d.toLowerCase()], function(n){
parsers[n] = parseLength
})
parsers[bd + "Color"] = parseColor
@@ -249,7 +249,7 @@ each(trbl, function(d){
}
})
-each(tlbl, function(d){
+forEach(tlbl, function(d){
parsers["border" + d + "Radius"] = parseLength
})
@@ -258,7 +258,7 @@ parsers.width = parsers.height = parsers.fontSize = parsers.backgroundSize = par
// margin + padding
-each(["margin", "padding"], function(name){
+forEach(["margin", "padding"], function(name){
parsers[name] = parseShort4
getters[name] = function(){
return map(trbl, function(d){
@@ -288,7 +288,7 @@ parsers.borderColor = function(value, normalize){
})).join(" "))
}
-each(["Width", "Style", "Color"], function(name){
+forEach(["Width", "Style", "Color"], function(name){
getters["border" + name] = function(){
return map(trbl, function(d){
return getter("border" + d + name).call(this)
@@ -359,8 +359,10 @@ var parseTextShadow = parsers.textShadow = function(value, normalize){
// Aliases
-each(['Webkit', "Moz", "ms", "O", null], function(prefix){
- each(["transition", "transform", "transformOrigin", "transformStyle", "perspective", "perspectiveOrigin", "backfaceVisibility"], function(style){
+forEach(['Webkit', "Moz", "ms", "O", null], function(prefix){
+ forEach([
+ "transition", "transform", "transformOrigin", "transformStyle", "perspective", "perspectiveOrigin", "backfaceVisibility"
+ ], function(style){
var cc = prefix ? prefix + capitalize(style) : style
if (prefix === "ms") hyphenated[cc] = "-ms-" + hyphenate(style)
if (test.style[cc] != null) aliases[style] = cc
@@ -449,7 +451,7 @@ if (!transitionName && transformName) (function(){
identity: function(){
var functions = []
- each(this.names, function(name){
+ forEach(this.names, function(name){
var fn = transforms[name]
if (fn) functions.push(name + "(" + fn() + ")")
})
@@ -478,7 +480,7 @@ if (!transitionName && transformName) (function(){
Transform2d.prototype.toString = function(clean){
var values = this.values, functions = []
- each(this.names, function(name, i){
+ forEach(this.names, function(name, i){
var fn = transforms[name]
if (!fn) return
var value = fn(values[i])
@@ -862,7 +864,7 @@ elements.implement({
var value = styles[property],
property = camelize(property)
- this.handle(function(node){
+ this.forEach(function(node){
length++
var self = elements(node), anims = self._animations || (self._animations = {})
var anim = anims[property] || (anims[property] = new BaseAnimation(node, property))
@@ -889,7 +891,7 @@ elements.implement({
var value = styles[property],
set = setter(property = camelize(property))
- this.handle(function(node){
+ this.forEach(function(node){
var self = elements(node), anims = self._animations, anim
if (anims && (anim = anims[property])) anim.stop(true)
set.call(node, value)

0 comments on commit 1a547e8

Please sign in to comment.