mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+22
-26
@@ -78,41 +78,37 @@ __PluginManager__.register('Logger', function(module, exports, require, global){
|
|||||||
document.body.appendChild(this.collection)
|
document.body.appendChild(this.collection)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Logger.prototype.__row = function(message, lvl = 0, opClass = '') {
|
Logger.prototype.__row = function(message, lvl = 0, opClass = '') {
|
||||||
if (!this.collection) {
|
if (!this.collection) {
|
||||||
this.setCollection();
|
this.setCollection();
|
||||||
}
|
}
|
||||||
var log = this.collection;
|
var log = this.collection;
|
||||||
var k = 0, j = 0, i = 0, m = 0, rowNode1, valNode1, rowNode2, isObj, val;
|
|
||||||
|
|
||||||
if(support.isObject(message)) {
|
function setObjectValue(log, lvl, key, value, opClass, depth = 3, openDepth = 1, isRoot = true) {
|
||||||
for(k in message) {
|
var rowChild, isObj = support.isObject(value), id = isObj?support.uniqueId():'',
|
||||||
log.appendChild(rowNode2 = getRowNode(lvl, k, message[k], opClass));
|
val = (isObj&&depth)?'<label for="'+id+'">'+value+'</label>':value, inp, j,
|
||||||
if(support.isObject(message[k])) {
|
len = isObj?Object.keys(value).length:0;
|
||||||
log.appendChild(rowNode1 = getItemObjectNode());
|
|
||||||
for(j in message[k]) {
|
if(!isRoot || (isRoot && !isObj)) {
|
||||||
isObj = support.isObject(message[k][j]);
|
log.appendChild(getRowNode(lvl, key, '' + val + (isObj?(' ['+len+']'):''), opClass));
|
||||||
id = support.uniqueId();
|
}
|
||||||
val = isObj?'<label for="'+id+'">'+message[k][j]+'</label>':message[k][j];
|
if(isObj&&depth) {
|
||||||
rowNode1.appendChild(getRowNode(lvl+1, j, val));
|
!isRoot && ++lvl;
|
||||||
rowNode1.appendChild(support.makeNode('<input id="'+id+'" type="checkbox" style="display: none;">'));
|
depth = Math.max(0, depth - 1);
|
||||||
if(isObj) {
|
log.appendChild(inp = support.makeNode('<input id="'+id+'" type="checkbox" style="display: none;">'));
|
||||||
rowNode1.appendChild(rowNode2 = getItemObjectNode(id));
|
inp.checked = !!openDepth;
|
||||||
for(i in message[k][j]) {
|
openDepth = Math.max(0, openDepth - 1);
|
||||||
rowNode2.appendChild(getRowNode(lvl+2, i, message[k][j][i]));
|
log.appendChild(rowChild = getItemObjectNode(id));
|
||||||
// if(typeof message[k][j][i] == 'object') {
|
for(j in value) {
|
||||||
// for(m in message[k][j][i]) {
|
if(value.hasOwnProperty(j))
|
||||||
// log.appendChild(getRowNode(lvl+3, m, message[k][j][i][m]));
|
setObjectValue(rowChild, lvl, j, value[j], opClass, depth, openDepth, false);
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
setObjectValue(log, lvl, '', message, opClass, 6, 3);
|
||||||
} else {
|
|
||||||
log.appendChild(getRowNode(lvl, '', message, opClass));
|
|
||||||
}
|
|
||||||
log.scrollTop = log.scrollHeight;
|
log.scrollTop = log.scrollHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user