infobox: fix image width of nodeInfo elements

This commit is contained in:
Nils Schneider 2015-05-21 17:57:02 +02:00
parent cbe21ee3df
commit 8b21589520
2 changed files with 43 additions and 31 deletions

View file

@ -134,7 +134,6 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
} }
function showStatImg(o, nodeId) { function showStatImg(o, nodeId) {
return function (el) {
var content, caption var content, caption
if (o.thumbnail) { if (o.thumbnail) {
@ -149,6 +148,8 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
content = document.createTextNode(caption) content = document.createTextNode(caption)
} }
var p = document.createElement("p")
if (o.href) { if (o.href) {
var link = document.createElement("a") var link = document.createElement("a")
link.target = "_blank" link.target = "_blank"
@ -158,10 +159,11 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
if (caption && o.thumbnail) if (caption && o.thumbnail)
link.title = caption link.title = caption
el.appendChild(link) p.appendChild(link)
} else } else
el.appendChild(content) p.appendChild(content)
}
return p
} }
return function(config, el, router, d) { return function(config, el, router, d) {
@ -193,13 +195,17 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
attributeEntry(attributes, "Autom. Updates", showAutoupdate(d)) attributeEntry(attributes, "Autom. Updates", showAutoupdate(d))
attributeEntry(attributes, "Clients", showClients(d)) attributeEntry(attributes, "Clients", showClients(d))
el.appendChild(attributes)
if (config.nodeInfos) if (config.nodeInfos)
config.nodeInfos.forEach( function (nodeInfo) { config.nodeInfos.forEach( function (nodeInfo) {
attributeEntry(attributes, nodeInfo.name, showStatImg(nodeInfo, d.nodeinfo.node_id)) var h4 = document.createElement("h4")
h4.textContent = nodeInfo.name
el.appendChild(h4)
el.appendChild(showStatImg(nodeInfo, d.nodeinfo.node_id))
}) })
el.appendChild(attributes)
if (d.neighbours.length > 0) { if (d.neighbours.length > 0) {
var h3 = document.createElement("h3") var h3 = document.createElement("h3")
h3.textContent = "Nachbarknoten (" + d.neighbours.length + ")" h3.textContent = "Nachbarknoten (" + d.neighbours.length + ")"

View file

@ -212,10 +212,16 @@ button.close {
padding-right: $buttondistance; padding-right: $buttondistance;
} }
.sidebar p, .sidebar table, .sidebar pre, .sidebar ul { .sidebar {
p, pre, ul, h4 {
padding: 0 $buttondistance 1em; padding: 0 $buttondistance 1em;
} }
table {
padding: 0 $buttondistance;
}
}
table { table {
border-spacing: 0 0.5em; border-spacing: 0 0.5em;
td, th { td, th {