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