infobox/node: resolve nexthop and gateway from data

not perfect yet: the mac address doesn't always match
This commit is contained in:
Milan Paessler 2016-11-19 02:17:08 +01:00
commit 9e7049c9e3
4 changed files with 30 additions and 8 deletions

View file

@ -2,6 +2,7 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
return function (config, sidebar, router) {
var self = this
var el
var nodeDict
function destroy() {
if (el && el.parentNode) {
@ -33,7 +34,7 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
self.gotoNode = function (d) {
create()
new Node(config, el, router, d)
new Node(config, el, router, d, nodeDict)
}
self.gotoLink = function (d) {
@ -46,6 +47,10 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
new Location(config, el, router, d)
}
self.setData = function (d) {
nodeDict = d.nodeDict
}
return self
}
})