Revize 9ed5d9f4
Přidáno uživatelem Pavel Fidranský před více než 6 roky(ů)
sources/src/main/webapp/js/components/sidebar.js | ||
---|---|---|
3 | 3 |
*/ |
4 | 4 |
function Sidebar() { |
5 | 5 |
var rootElement; |
6 |
var activeChangeElement; |
|
7 | 6 |
|
8 | 7 |
/** @prop {SidebarUnconnectedNodeList} unconnectedNodeListComponent */ |
9 | 8 |
this.unconnectedNodeListComponent = null; |
sources/src/main/webapp/js/services/graphLoader.js | ||
---|---|---|
50 | 50 |
var vertex = new Vertex(component); |
51 | 51 |
|
52 | 52 |
if (highlightedNodeType === 'vertex' && highlightedNodeId === vertex.id ){ |
53 |
highlightedNode = vertex;
|
|
53 |
highlightedNode = vertex;
|
|
54 | 54 |
} |
55 | 55 |
|
56 | 56 |
var position = component.position; |
... | ... | |
76 | 76 |
data.edges.forEach(component => { |
77 | 77 |
var edge = new Edge(component); |
78 | 78 |
|
79 |
if (highlightedEdgeId === edge.id ){
|
|
80 |
highlightedEdge = edge;
|
|
81 |
}
|
|
79 |
if (highlightedEdgeId === edge.id) {
|
|
80 |
highlightedEdge = edge;
|
|
81 |
}
|
|
82 | 82 |
|
83 | 83 |
var fromNode = vertexMap[component.from]; |
84 | 84 |
if (fromNode) { |
... | ... | |
121 | 121 |
data.groups.forEach(component => { |
122 | 122 |
var group = new Group(component); |
123 | 123 |
|
124 |
if (highlightedNodeType === 'group' && highlightedNodeId === group.id ){
|
|
125 |
highlightedNode = group;
|
|
126 |
}
|
|
124 |
if (highlightedNodeType === 'group' && highlightedNodeId === group.id) {
|
|
125 |
highlightedNode = group;
|
|
126 |
}
|
|
127 | 127 |
|
128 | 128 |
// position |
129 | 129 |
var position = component.position; |
... | ... | |
153 | 153 |
|
154 | 154 |
// exclude nodes |
155 | 155 |
data.sideBar.forEach(excludedNode => { |
156 |
if(typeof excludedNode.id !== 'string' && !(excludedNode.id instanceof String)) { |
|
157 |
return; |
|
158 |
} |
|
159 |
var idArr = excludedNode.id.split("-"); |
|
160 |
if(idArr.length !== 2){ |
|
161 |
return; |
|
162 |
} |
|
163 |
idArr[1] = parseInt(idArr[1], 10); |
|
156 |
if (typeof excludedNode.id !== 'string' && !(excludedNode.id instanceof String)) return; |
|
157 |
|
|
158 |
let idArr = excludedNode.id.split('-'); |
|
159 |
if (idArr.length !== 2) return; |
|
160 |
|
|
161 |
idArr[1] = parseInt(idArr[1], 10); |
|
164 | 162 |
|
165 | 163 |
let node = app.nodeList.find(node => { |
166 | 164 |
let prefix = ''; |
... | ... | |
169 | 167 |
} else if (node instanceof Group) { |
170 | 168 |
prefix = 'group'; |
171 | 169 |
} |
170 |
|
|
172 | 171 |
return idArr[0] === prefix && node.id === idArr[1]; |
173 | 172 |
}); |
174 | 173 |
|
sources/src/main/webapp/js/showGraphApp.js | ||
---|---|---|
65 | 65 |
this.groupList = []; |
66 | 66 |
} |
67 | 67 |
|
68 |
/** |
|
69 |
* Finds a vertex by its name. |
|
70 |
* @param {string} name Name of the searched vertex. |
|
71 |
*/ |
|
72 |
findVertexByName(name) { |
|
73 |
return this.vertexList.find(existingVertex => { |
|
74 |
return existingVertex.name == name; |
|
75 |
}); |
|
76 |
} |
|
77 |
|
|
78 | 68 |
/** |
79 | 69 |
* Closes components floating above viewport (context menu and popovers). |
80 | 70 |
*/ |
Také k dispozici: Unified diff
minor code cleanup