Skip to content
Snippets Groups Projects
Commit fd6c7c7f authored by Xaver Maierhofer's avatar Xaver Maierhofer Committed by Xaver Maierhofer
Browse files

[TASK] Pass children to attributeEntry

parent 6091a8b8
No related branches found
No related tags found
No related merge requests found
...@@ -37,17 +37,18 @@ define(['helper', 'snabbdom'], function (helper, V) { ...@@ -37,17 +37,18 @@ define(['helper', 'snabbdom'], function (helper, V) {
header = V.patch(header, V.h('div', headers)); header = V.patch(header, V.h('div', headers));
children.push(helper.attributeEntry(V, 'node.connectionType', d.type)); helper.attributeEntry(V, children, 'node.connectionType', d.type);
children.push(helper.attributeEntry(V, 'node.tq', V.h('span', helper.attributeEntry(V, children, 'node.tq', V.h('span',
{ {
style: style:
{ {
color: linkScale((d.source_tq + d.target_tq) / 2) color: linkScale((d.source_tq + d.target_tq) / 2)
} }
}, helper.showTq(d.source_tq) + ' - ' + helper.showTq(d.target_tq)))); }, helper.showTq(d.source_tq) + ' - ' + helper.showTq(d.target_tq))
children.push(helper.attributeEntry(V, 'node.distance', helper.showDistance(d))); );
children.push(helper.attributeEntry(V, 'node.hardware', (d.source.model ? d.source.model + '' : '') + helper.attributeEntry(V, children, 'node.distance', helper.showDistance(d));
(d.target.model ? d.target.model : ''))); helper.attributeEntry(V, children, 'node.hardware', (d.source.model ? d.source.model + '' : '') +
(d.target.model ? d.target.model : ''));
var elNew = V.h('table', children); var elNew = V.h('table', children);
table = V.patch(table, elNew); table = V.patch(table, elNew);
......
...@@ -138,7 +138,11 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no ...@@ -138,7 +138,11 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no
} }
}); });
children.push(helper.attributeEntry(V, 'node.gateway', showGateway(d)));
children.push(V.h('tr', [
V.h('th', _.t('node.gateway')),
showGateway(d)
]));
var elNew = V.h('table', children); var elNew = V.h('table', children);
table = V.patch(table, elNew); table = V.patch(table, elNew);
......
...@@ -104,19 +104,17 @@ define({ ...@@ -104,19 +104,17 @@ define({
return (d * 100).toFixed(0) + '%'; return (d * 100).toFixed(0) + '%';
}, },
attributeEntry: function attributeEntry(V, label, value) { attributeEntry: function attributeEntry(V, children, label, value) {
if (value === undefined) { if (value !== undefined) {
return '';
}
if (typeof value !== 'object') { if (typeof value !== 'object') {
value = V.h('td', value); value = V.h('td', value);
} }
return V.h('tr', [ children.push(V.h('tr', [
V.h('th', _.t(label)), V.h('th', _.t(label)),
value value
]); ]));
}
}, },
showStat: function showStat(V, o, subst) { showStat: function showStat(V, o, subst) {
var content; var content;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment