Start/stop nodes, fixes: #12

This commit is contained in:
ziajka 2017-11-30 09:07:28 +01:00
parent 2ab96ab323
commit 4caeb2a4c7
2 changed files with 10 additions and 13 deletions

View File

@ -46,13 +46,8 @@ export class NodesWidget implements Widget {
const node_image = node_enter.append<SVGImageElement>('image')
.attr('xlink:href', (n: Node) => 'data:image/svg+xml;base64,' + btoa(n.icon.raw))
.attr('width', (n: Node) => n.width)
.attr('height', (n: Node) => n.height)
.on("contextmenu", function (n: Node, i: number) {
event.preventDefault();
if (self.onContextMenuCallback !== null) {
self.onContextMenuCallback(event, n);
}
});
.attr('height', (n: Node) => n.height);
node_enter.append<SVGCircleElement>('circle')
.attr('class', 'node_point')
@ -67,6 +62,12 @@ export class NodesWidget implements Widget {
.attr('y', '0');
const node_merge = node.merge(node_enter)
.on("contextmenu", function (n: Node, i: number) {
event.preventDefault();
if (self.onContextMenuCallback !== null) {
self.onContextMenuCallback(event, n);
}
})
.attr('transform', (n: Node) => {
return `translate(${n.x},${n.y})`;
});

View File

@ -25,11 +25,8 @@ import { Snapshot } from "../shared/models/snapshot";
import { ProgressDialogService } from "../shared/progress-dialog/progress-dialog.service";
import { ProgressDialogComponent } from "../shared/progress-dialog/progress-dialog.component";
import { ToastyService } from "ng2-toasty";
import {Drawing} from "../cartography/shared/models/drawing.model";
import {StartNodeAction} from "../shared/node-context-menu/actions/start-node-action";
import {NodeService} from "../shared/services/node.service";
import {StopNodeAction} from "../shared/node-context-menu/actions/stop-node-action";
import {NodeContextMenuComponent} from "../shared/node-context-menu/node-context-menu.component";
import { Drawing } from "../cartography/shared/models/drawing.model";
import { NodeContextMenuComponent } from "../shared/node-context-menu/node-context-menu.component";
@Component({
@ -58,7 +55,6 @@ export class ProjectMapComponent implements OnInit {
private projectService: ProjectService,
private symbolService: SymbolService,
private snapshotService: SnapshotService,
private nodeService: NodeService,
private dialog: MatDialog,
private progressDialogService: ProgressDialogService,
private toastyService: ToastyService) {