Project toolbar toggle moving button

This commit is contained in:
ziajka 2018-03-13 14:04:42 +01:00
parent ca1a6ad6cd
commit 2449ba8c66
4 changed files with 23 additions and 10 deletions

View File

@ -82,7 +82,7 @@ export class GraphLayout implements Widget {
this.drawingsWidget.draw(canvas, this.drawings);
// this.drawingLineTool.connect(view, context);
this.drawingLineTool.connect(view);
this.selectionTool.connect(view, context);
// const onZoom = function(this: SVGSVGElement) {

View File

@ -66,3 +66,10 @@ g.node text,
-ms-user-select: none;
user-select: none;
}
/* Disable outline after button click */
.project-toolbar button {
outline: 0;
border: none;
-moz-outline-style: none
}

View File

@ -9,7 +9,7 @@
<mat-icon svgIcon="gns3"></mat-icon>
</button>
</mat-toolbar-row>
<mat-menu #mainMenu="matMenu" [overlapTrigger]="false">
<button mat-menu-item [routerLink]="['/server', server.id, 'projects']">
<mat-icon>work</mat-icon>
@ -22,12 +22,14 @@
</mat-menu>
<mat-toolbar-row>
<button mat-icon-button (click)="turnOnDrawLineMode()" *ngIf="!drawLineMode">
<button mat-icon-button [color]="drawLineMode ? 'primary': 'basic'" (click)="toggleDrawLineMode()">
<mat-icon>timeline</mat-icon>
</button>
</mat-toolbar-row>
<button mat-icon-button color="primary" (click)="turnOffDrawLineMode()" *ngIf="drawLineMode">
<mat-icon>timeline</mat-icon>
<mat-toolbar-row>
<button mat-icon-button [color]="movingMode ? 'primary': 'basic'" (click)="toggleMovingMode()">
<mat-icon>zoom_out_map</mat-icon>
</button>
</mat-toolbar-row>

View File

@ -52,6 +52,8 @@ export class ProjectMapComponent implements OnInit {
private ws: Subject<any>;
private drawLineMode = false;
private movingMode = false;
public isLoading = true;
@ViewChild(MapComponent) mapChild: MapComponent;
@ -255,13 +257,15 @@ export class ProjectMapComponent implements OnInit {
});
}
public turnOnDrawLineMode() {
this.drawLineMode = true;
public toggleDrawLineMode() {
this.drawLineMode = !this.drawLineMode;
if (!this.drawLineMode) {
this.mapChild.graphLayout.getDrawingLineTool().stop();
}
}
public turnOffDrawLineMode() {
this.drawLineMode = false;
this.mapChild.graphLayout.getDrawingLineTool().stop();
public toggleMovingMode() {
this.movingMode = !this.movingMode;
}
public onChooseInterface(event) {