mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-20 17:52:46 +00:00
Merge pull request #53 from GNS3/restore-functionalities
Restore functionality, Fixes: #50
This commit is contained in:
commit
e563dd6381
@ -95,7 +95,7 @@ export class MapComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
this.graphLayout = new GraphLayout();
|
||||
|
||||
this.graphLayout.getNodesWidget().addOnNodeDraggingCallback((n: Node) => {
|
||||
this.graphLayout.getNodesWidget().addOnNodeDraggingCallback((event: any, n: Node) => {
|
||||
const linksWidget = this.graphLayout.getLinksWidget();
|
||||
linksWidget.select(this.svg).each(function(this: SVGGElement, link: Link) {
|
||||
if (link.target.node_id === n.node_id || link.source.node_id === n.node_id) {
|
||||
|
@ -23,7 +23,7 @@ export class LinksWidget implements Widget {
|
||||
return view.selectAll<SVGGElement, Link>("g.link");
|
||||
}
|
||||
|
||||
public revise(selection: Selection<BaseType, Link, SVGElement, any>) {
|
||||
public revise(selection: SVGSelection) {
|
||||
const self = this;
|
||||
|
||||
selection
|
||||
@ -120,7 +120,9 @@ export class LinksWidget implements Widget {
|
||||
.attr('map-source', (l: Link) => l.source.node_id)
|
||||
.attr('map-target', (l: Link) => l.target.node_id)
|
||||
|
||||
//this.revise(link.merge(link_enter));
|
||||
const merge = link.merge(link_enter);
|
||||
|
||||
this.revise(merge);
|
||||
|
||||
link
|
||||
.exit()
|
||||
|
@ -30,7 +30,7 @@ export class NodesWidget implements Widget {
|
||||
this.onNodeDraggedCallback = onNodeDraggedCallback;
|
||||
}
|
||||
|
||||
public addOnNodeDraggingCallback(onNodeDraggingCallback: (n: Node) => void) {
|
||||
public addOnNodeDraggingCallback(onNodeDraggingCallback: (event: any, n: Node) => void) {
|
||||
this.onNodeDraggingCallbacks.push(onNodeDraggingCallback);
|
||||
}
|
||||
|
||||
@ -38,10 +38,10 @@ export class NodesWidget implements Widget {
|
||||
this.symbols = symbols;
|
||||
}
|
||||
|
||||
private executeOnNodeDraggingCallback(n: Node) {
|
||||
// this.onNodeDraggingCallbacks.forEach((callback: (n: Node) => void) => {
|
||||
// callback(n);
|
||||
// });
|
||||
private executeOnNodeDraggingCallback(callback_event: any, node: Node) {
|
||||
this.onNodeDraggingCallbacks.forEach((callback: (e: any, n: Node) => void) => {
|
||||
callback(callback_event, node);
|
||||
});
|
||||
}
|
||||
|
||||
public revise(selection: SVGSelection) {
|
||||
@ -157,7 +157,7 @@ export class NodesWidget implements Widget {
|
||||
n.y = e.y;
|
||||
|
||||
self.revise(select(this));
|
||||
self.executeOnNodeDraggingCallback(n);
|
||||
self.executeOnNodeDraggingCallback(event, n);
|
||||
};
|
||||
|
||||
const dragging = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user