From a911e8cc5ca8c9889f2e38fc524fb553cf8b5ddb Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 22 Mar 2015 15:27:16 +0100 Subject: [PATCH] use has_location --- history.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/history.js b/history.js index b01ed3f..49f409f 100644 --- a/history.js +++ b/history.js @@ -229,9 +229,7 @@ function mkmap(map, newnodes, lostnodes, onlinenodes, graph, gotoAnything) { var markersDict = addLinksToMap(map, graph, gotoAnything) - var nodes = newnodes.concat(lostnodes).filter( function (d) { - return "location" in d.nodeinfo - }) + var nodes = newnodes.concat(lostnodes).filter(has_location) var markers = nodes.map( function (d) { var icon = L.AwesomeMarkers.icon({ markerColor: d.flags.online ? "green" : "red", @@ -372,7 +370,7 @@ function addToList(el, showContact, tf, gotoProxy, list) { a.onclick = gotoProxy(d) td1.appendChild(a) - if ("location" in d.nodeinfo) { + if (has_location(d)) { var span = document.createElement("span") span.classList.add("icon") span.classList.add("ion-location") @@ -443,7 +441,7 @@ function showNodeinfo(config, gotoAnything, d) { attributes.classList.add("attributes") attributeEntry(attributes, "Gateway", d.flags.gateway ? "ja" : null) - attributeEntry(attributes, "In der Karte", "location" in d.nodeinfo ? "ja" : "nein") + attributeEntry(attributes, "In der Karte", has_location(d) ? "ja" : "nein") if (config.showContact) attributeEntry(attributes, "Kontakt", dictGet(d.nodeinfo, ["owner", "contact"]))