mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-16 05:48:10 +00:00
Context menu for inserted drawings
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
<button mat-menu-item (click)="editStyle()">
|
<button mat-menu-item *ngIf="!isImageDrawing" (click)="editStyle()">
|
||||||
<mat-icon>style</mat-icon>
|
<mat-icon>style</mat-icon>
|
||||||
<span>Edit style</span>
|
<span>Edit style</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -1,22 +1,26 @@
|
|||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, Input, OnChanges } from '@angular/core';
|
||||||
import { Drawing } from '../../../../../cartography/models/drawing';
|
import { Drawing } from '../../../../../cartography/models/drawing';
|
||||||
import { Server } from '../../../../../models/server';
|
import { Server } from '../../../../../models/server';
|
||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material';
|
||||||
import { Project } from '../../../../../models/project';
|
import { Project } from '../../../../../models/project';
|
||||||
import { StyleEditorDialogComponent } from '../../../drawings-editors/style-editor/style-editor.component';
|
import { StyleEditorDialogComponent } from '../../../drawings-editors/style-editor/style-editor.component';
|
||||||
|
import { ImageElement } from '../../../../../cartography/models/drawings/image-element';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit-style-action',
|
selector: 'app-edit-style-action',
|
||||||
templateUrl: './edit-style-action.component.html'
|
templateUrl: './edit-style-action.component.html'
|
||||||
})
|
})
|
||||||
export class EditStyleActionComponent implements OnInit {
|
export class EditStyleActionComponent implements OnChanges {
|
||||||
@Input() server: Server;
|
@Input() server: Server;
|
||||||
@Input() project: Project;
|
@Input() project: Project;
|
||||||
@Input() drawing: Drawing;
|
@Input() drawing: Drawing;
|
||||||
|
isImageDrawing: boolean = false;
|
||||||
|
|
||||||
constructor(private dialog: MatDialog) {}
|
constructor(private dialog: MatDialog) {}
|
||||||
|
|
||||||
ngOnInit() {}
|
ngOnChanges() {
|
||||||
|
this.isImageDrawing = this.drawing.element instanceof ImageElement;
|
||||||
|
}
|
||||||
|
|
||||||
editStyle() {
|
editStyle() {
|
||||||
const dialogRef = this.dialog.open(StyleEditorDialogComponent, {
|
const dialogRef = this.dialog.open(StyleEditorDialogComponent, {
|
||||||
|
Reference in New Issue
Block a user