mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-19 17:03:08 +00:00
Update bring-to-front-action.component.ts
This commit is contained in:
parent
ac3335a33d
commit
1622d7d60a
@ -26,15 +26,20 @@ export class BringToFrontActionComponent implements OnInit {
|
|||||||
ngOnInit() {}
|
ngOnInit() {}
|
||||||
|
|
||||||
bringToFront() {
|
bringToFront() {
|
||||||
|
let maxZValueForNodes = Math.max(...this.nodes.map(n => n.z));
|
||||||
|
let maxZValueForDrawings = Math.max(...this.drawings.map(n => n.z));
|
||||||
|
let maxZValue = Math.max(maxZValueForNodes, maxZValueForDrawings);
|
||||||
|
if (maxZValue < 100) maxZValue++;
|
||||||
|
|
||||||
this.nodes.forEach((node) => {
|
this.nodes.forEach((node) => {
|
||||||
node.z = 100;
|
node.z = maxZValue;
|
||||||
this.nodesDataSource.update(node);
|
this.nodesDataSource.update(node);
|
||||||
|
|
||||||
this.nodeService.update(this.server, node).subscribe((node: Node) => {});
|
this.nodeService.update(this.server, node).subscribe((node: Node) => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.drawings.forEach((drawing) => {
|
this.drawings.forEach((drawing) => {
|
||||||
drawing.z = 100;
|
drawing.z = maxZValue;
|
||||||
this.drawingsDataSource.update(drawing);
|
this.drawingsDataSource.update(drawing);
|
||||||
|
|
||||||
this.drawingService.update(this.server, drawing).subscribe((drawing: Drawing) => {});
|
this.drawingService.update(this.server, drawing).subscribe((drawing: Drawing) => {});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user