diff --git a/lib/infobox/node.js b/lib/infobox/node.js index cd5a699..1de0ffe 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -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) { diff --git a/lib/linklist.js b/lib/linklist.js index 5e77348..cc5b190 100644 --- a/lib/linklist.js +++ b/lib/linklist.js @@ -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)) diff --git a/scss/modules/_sidebar.scss b/scss/modules/_sidebar.scss index 4dfd2db..ba6794a 100644 --- a/scss/modules/_sidebar.scss +++ b/scss/modules/_sidebar.scss @@ -30,7 +30,8 @@ } .node-list, - .node-links { + .node-links, + .link-list { th, td { &:first-child { @@ -47,25 +48,22 @@ } } + .link-list { + th, + td { + &:nth-child(2) { + width: 60%; + } + } + } + .node-links { padding-bottom: 15px; th, td { &:first-child { - width: 25px; - } - } - } - - .link-list { - th, - td { - &:nth-child(1) { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: 60%; + width: 35px; } } }