mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-02 16:52:50 +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() {
|
ngOnDestroy() {
|
||||||
if (this.svg.empty && !this.svg.empty()) {
|
this.graphLayout.disconnect(this.svg);
|
||||||
this.svg.selectAll('*').remove();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -5,13 +5,10 @@ import { NodesWidget } from "./nodes.widget";
|
|||||||
import { Widget } from "./widget";
|
import { Widget } from "./widget";
|
||||||
import { SVGSelection } from "../../../map/models/types";
|
import { SVGSelection } from "../../../map/models/types";
|
||||||
import { LinksWidget } from "./links.widget";
|
import { LinksWidget } from "./links.widget";
|
||||||
import { D3ZoomEvent, zoom } from "d3-zoom";
|
|
||||||
import { event } from "d3-selection";
|
|
||||||
import { Drawing } from "../models/drawing.model";
|
import { Drawing } from "../models/drawing.model";
|
||||||
import { DrawingsWidget } from "./drawings.widget";
|
import { DrawingsWidget } from "./drawings.widget";
|
||||||
import { DrawingLineWidget } from "./drawing-line.widget";
|
import { DrawingLineWidget } from "./drawing-line.widget";
|
||||||
import {SelectionTool} from "../tools/selection-tool";
|
import {SelectionTool} from "../tools/selection-tool";
|
||||||
import {Tool} from "../tool";
|
|
||||||
import {MovingTool} from "../tools/moving-tool";
|
import {MovingTool} from "../tools/moving-tool";
|
||||||
|
|
||||||
export class GraphLayout implements Widget {
|
export class GraphLayout implements Widget {
|
||||||
@ -101,4 +98,9 @@ export class GraphLayout implements Widget {
|
|||||||
this.movingTool.draw(view, context);
|
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