Skip to content
Snippets Groups Projects
Unverified Commit 1673fe12 authored by Xaver Maierhofer's avatar Xaver Maierhofer
Browse files

[TASK] Add link type in lists

parent c3cda56f
No related branches found
No related tags found
No related merge requests found
......@@ -61,9 +61,9 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no
}
function renderNeighbourRow(n) {
var icons = '';
var icons = [V.h('span', { props: { className: 'icon ion-' + (n.link.type.indexOf('wifi') === 0 ? 'wifi' : 'share-alt'), title: _.t(n.link.type) } })];
if (helper.hasLocation(n.node)) {
icons = V.h('span', { props: { className: 'ion-location' } });
icons.push(V.h('span', { props: { className: 'ion-location' } }));
}
return V.h('tr', [
......@@ -81,7 +81,10 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'moment', 'helper', 'utils/no
var images = document.createElement('div');
var neighbours = document.createElement('h3');
var headings = [{
name: ''
name: '',
sort: function (a, b) {
return a.link.type.localeCompare(b.link.type);
}
}, {
name: 'node.nodes',
sort: function (a, b) {
......
......@@ -7,6 +7,11 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) {
}
var headings = [{
name: '',
sort: function (a, b) {
return a.type.localeCompare(b.type);
}
}, {
name: 'node.nodes',
sort: function (a, b) {
return linkName(a).localeCompare(linkName(b));
......@@ -30,7 +35,7 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) {
}];
return function (linkScale) {
var table = new SortTable(headings, 2, renderRow);
var table = new SortTable(headings, 3, renderRow);
function renderRow(d) {
var td1Content = [V.h('a', {
......@@ -44,6 +49,7 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) {
}, linkName(d))];
return V.h('tr', [
V.h('td', V.h('span', { props: { className: 'icon ion-' + (d.type.indexOf('wifi') === 0 ? 'wifi' : 'share-alt'), title: _.t(d.type) } })),
V.h('td', td1Content),
V.h('td', { style: { color: linkScale((d.source_tq + d.target_tq) / 2) } }, helper.showTq(d.source_tq) + ' - ' + helper.showTq(d.target_tq)),
V.h('td', helper.showDistance(d))
......
......@@ -30,7 +30,8 @@
}
.node-list,
.node-links {
.node-links,
.link-list {
th,
td {
&:first-child {
......@@ -47,25 +48,22 @@
}
}
.node-links {
padding-bottom: 15px;
.link-list {
th,
td {
&:first-child {
width: 25px;
&:nth-child(2) {
width: 60%;
}
}
}
.link-list {
.node-links {
padding-bottom: 15px;
th,
td {
&:nth-child(1) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 60%;
&:first-child {
width: 35px;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment