1
0
Fork 0
forked from 0x2620/oxjs

temporary fix for video skipping bug (#716); add third parameter (index) to forEach callback; add Geo colors

This commit is contained in:
rlx 2012-03-25 21:23:03 +00:00
commit 17aca54e7a
5 changed files with 57 additions and 50 deletions

View file

@ -169,7 +169,7 @@ Ox.forEach <f> forEach loop
"012abcfoo"
@*/
Ox.forEach = function(col, fn, includePrototype) {
var isObject = Ox.isObject(col), key;
var ind = 0, isObject = Ox.isObject(col), key;
// Safari will not loop through an arguments array
col = Ox.isArguments(col) ? Ox.makeArray(col) : col;
for (key in col) {
@ -177,7 +177,7 @@ Ox.forEach = function(col, fn, includePrototype) {
// fixme: fn.call(context, obj[key], key, obj) may be more standard...
if ((
includePrototype || Object.hasOwnProperty.call(col, key)
) && fn(col[key], key) === false) {
) && fn(col[key], key, ind++) === false) {
break;
}
}