infobox/node: move direction indicator to own column

This commit is contained in:
Milan Pässler 2016-02-18 17:42:42 +00:00
parent 1cb22c45f5
commit 3a7cc2bbc5
2 changed files with 26 additions and 22 deletions

View file

@ -233,18 +233,22 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
var tr = document.createElement("tr") var tr = document.createElement("tr")
var th1 = document.createElement("th") var th1 = document.createElement("th")
th1.textContent = "Knoten" th1.textContent = " "
th1.classList.add("sort-default")
tr.appendChild(th1) tr.appendChild(th1)
var th2 = document.createElement("th") var th2 = document.createElement("th")
th2.textContent = "TQ" th2.textContent = "Knoten"
th2.classList.add("sort-default")
tr.appendChild(th2) tr.appendChild(th2)
var th3 = document.createElement("th") var th3 = document.createElement("th")
th3.textContent = "Entfernung" th3.textContent = "TQ"
tr.appendChild(th3) tr.appendChild(th3)
var th4 = document.createElement("th")
th4.textContent = "Entfernung"
tr.appendChild(th4)
thead.appendChild(tr) thead.appendChild(tr)
table.appendChild(thead) table.appendChild(thead)
@ -254,13 +258,16 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
var tr = document.createElement("tr") var tr = document.createElement("tr")
var td1 = document.createElement("td") var td1 = document.createElement("td")
td1.appendChild(document.createTextNode(d.incoming ? " ← " : " → "))
tr.appendChild(td1)
var td2 = document.createElement("td")
var a1 = document.createElement("a") var a1 = document.createElement("a")
a1.classList.add("hostname") a1.classList.add("hostname")
a1.textContent = d.node.nodeinfo.hostname a1.textContent = d.node.nodeinfo.hostname
a1.href = "#" a1.href = "#"
a1.onclick = router.node(d.node) a1.onclick = router.node(d.node)
td1.appendChild(document.createTextNode(d.incoming ? " ← " : " → ")) td2.appendChild(a1)
td1.appendChild(a1)
if (d.link.vpn) if (d.link.vpn)
td1.appendChild(document.createTextNode(" (VPN)")) td1.appendChild(document.createTextNode(" (VPN)"))
@ -271,27 +278,27 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
var span = document.createElement("span") var span = document.createElement("span")
span.classList.add("icon") span.classList.add("icon")
span.classList.add("ion-location") span.classList.add("ion-location")
td1.appendChild(span) td2.appendChild(span)
} }
tr.appendChild(td1) tr.appendChild(td2)
var td2 = document.createElement("td") var td3 = document.createElement("td")
var a2 = document.createElement("a") var a2 = document.createElement("a")
a2.href = "#" a2.href = "#"
a2.textContent = showTq(d.link) a2.textContent = showTq(d.link)
a2.onclick = router.link(d.link) a2.onclick = router.link(d.link)
td2.appendChild(a2) td3.appendChild(a2)
tr.appendChild(td2) tr.appendChild(td3)
var td3 = document.createElement("td") var td4 = document.createElement("td")
var a3 = document.createElement("a") var a3 = document.createElement("a")
a3.href = "#" a3.href = "#"
a3.textContent = showDistance(d.link) a3.textContent = showDistance(d.link)
a3.onclick = router.link(d.link) a3.onclick = router.link(d.link)
td3.appendChild(a3) td4.appendChild(a3)
td3.setAttribute("data-sort", d.link.distance !== undefined ? -d.link.distance : 1) td4.setAttribute("data-sort", d.link.distance !== undefined ? -d.link.distance : 1)
tr.appendChild(td3) tr.appendChild(td4)
tbody.appendChild(tr) tbody.appendChild(tr)
}) })

View file

@ -237,8 +237,8 @@ table {
font-weight: bold; font-weight: bold;
} }
.sidebar table th:first-child, .sidebar table th:nth-child(2),
.sidebar table td:first-child { .sidebar table td:nth-child(2) {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -247,10 +247,7 @@ table {
.sidebar table th:first-child, .sidebar table th:first-child,
.sidebar table td:first-child { .sidebar table td:first-child {
white-space: nowrap; width: 1.5em;
overflow: hidden;
text-overflow: ellipsis;
width: 60%;
} }
.sidebarhandle { .sidebarhandle {
@ -307,7 +304,7 @@ table {
text-align: left; text-align: left;
} }
.sidebar td:not(:first-child), .sidebar th:not(:first-child) { .sidebar td:not(:nth-child(-n+2)), .sidebar th:not(:nth-child(-n+2)) {
text-align: right; text-align: right;
} }