mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
code style revision
thanks, Jeremy... will watch out for that
This commit is contained in:
parent
1e47a62c2a
commit
0f157cff90
12
boot/boot.js
12
boot/boot.js
@ -62,19 +62,23 @@ $tw.utils.isDate = function(value) {
|
|||||||
Iterate through all the own properties of an object or array. Callback is invoked with (element,title,object)
|
Iterate through all the own properties of an object or array. Callback is invoked with (element,title,object)
|
||||||
*/
|
*/
|
||||||
$tw.utils.each = function(object,callback) {
|
$tw.utils.each = function(object,callback) {
|
||||||
var next, f;
|
var next,f;
|
||||||
|
|
||||||
if(object) {
|
if(object) {
|
||||||
if(Object.prototype.toString.call(object) == "[object Array]") {
|
if(Object.prototype.toString.call(object) == "[object Array]") {
|
||||||
for (f = 0; f < object.length; f++) {
|
for (f=0; f<object.length; f++) {
|
||||||
next = callback(object[f],f);
|
next = callback(object[f],f);
|
||||||
if (next === false) break;
|
if(next === false) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(f in object) {
|
for(f in object) {
|
||||||
if(Object.prototype.hasOwnProperty.call(object,f)) {
|
if(Object.prototype.hasOwnProperty.call(object,f)) {
|
||||||
next = callback(object[f],f,object);
|
next = callback(object[f],f,object);
|
||||||
if (next === false) break;
|
if(next === false) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user