2015-04-05 23:44:43 +02:00
|
|
|
|
define(function () {
|
|
|
|
|
return function (config) {
|
|
|
|
|
function setTitle(d) {
|
|
|
|
|
var title = [config.siteName]
|
|
|
|
|
|
|
|
|
|
if (d !== undefined)
|
|
|
|
|
title.push(d)
|
|
|
|
|
|
|
|
|
|
document.title = title.join(": ")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.resetView = function () {
|
|
|
|
|
setTitle()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.gotoNode = function (d) {
|
|
|
|
|
if (d)
|
|
|
|
|
setTitle(d.nodeinfo.hostname)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.gotoLink = function (d) {
|
|
|
|
|
if (d)
|
2016-02-27 14:43:27 +01:00
|
|
|
|
setTitle((d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + " – " + d.target.node.nodeinfo.hostname)
|
2015-04-05 23:44:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-25 15:47:07 +01:00
|
|
|
|
this.gotoLocation = function() {
|
|
|
|
|
//ignore
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-05 23:44:43 +02:00
|
|
|
|
this.destroy = function () {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this
|
|
|
|
|
}
|
|
|
|
|
})
|