mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-20 17:52:46 +00:00
Move clearing graph layout into disconnect
This commit is contained in:
parent
e2bcd72319
commit
7224bade9c
@ -68,9 +68,7 @@ export class MapComponent implements OnInit, OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.svg.empty && !this.svg.empty()) {
|
||||
this.svg.selectAll('*').remove();
|
||||
}
|
||||
this.graphLayout.disconnect(this.svg);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -5,13 +5,10 @@ import { NodesWidget } from "./nodes.widget";
|
||||
import { Widget } from "./widget";
|
||||
import { SVGSelection } from "../../../map/models/types";
|
||||
import { LinksWidget } from "./links.widget";
|
||||
import { D3ZoomEvent, zoom } from "d3-zoom";
|
||||
import { event } from "d3-selection";
|
||||
import { Drawing } from "../models/drawing.model";
|
||||
import { DrawingsWidget } from "./drawings.widget";
|
||||
import { DrawingLineWidget } from "./drawing-line.widget";
|
||||
import {SelectionTool} from "../tools/selection-tool";
|
||||
import {Tool} from "../tool";
|
||||
import {MovingTool} from "../tools/moving-tool";
|
||||
|
||||
export class GraphLayout implements Widget {
|
||||
@ -101,4 +98,9 @@ export class GraphLayout implements Widget {
|
||||
this.movingTool.draw(view, context);
|
||||
}
|
||||
|
||||
disconnect(view: SVGSelection) {
|
||||
if (view.empty && !view.empty()) {
|
||||
view.selectAll('*').remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user