Total Complexity | 9 |
Complexity/F | 1.13 |
Lines of Code | 36 |
Function Count | 8 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | define(function () { |
||
2 | 'use strict'; |
||
3 | |||
4 | return function () { |
||
5 | function setTitle(d) { |
||
6 | var title = [config.siteName]; |
||
7 | |||
8 | if (d !== undefined) { |
||
9 | title.unshift(d); |
||
10 | } |
||
11 | |||
12 | document.title = title.join(' - '); |
||
13 | } |
||
14 | |||
15 | this.resetView = function resetView() { |
||
16 | setTitle(); |
||
17 | }; |
||
18 | |||
19 | this.gotoNode = function gotoNode(d) { |
||
20 | setTitle(d.hostname); |
||
21 | }; |
||
22 | |||
23 | this.gotoLink = function gotoLink(d) { |
||
24 | setTitle(d[0].source.hostname + ' \u21D4 ' + d[0].target.hostname); |
||
25 | }; |
||
26 | |||
27 | this.gotoLocation = function gotoLocation() { |
||
28 | // ignore |
||
29 | }; |
||
30 | |||
31 | this.destroy = function destroy() { |
||
32 | }; |
||
33 | |||
34 | return this; |
||
35 | }; |
||
36 | }); |
||
37 |