From 31d7719fee22c04e8068c80f1c31b3f402e849a6 Mon Sep 17 00:00:00 2001 From: Piotr Pekala Date: Mon, 21 Oct 2019 07:03:37 -0700 Subject: [PATCH] Context menu for inserted drawings --- .../edit-style-action/edit-style-action.component.html | 2 +- .../edit-style-action/edit-style-action.component.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.html b/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.html index 9e6258d3..6c23bb7b 100644 --- a/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.html +++ b/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.html @@ -1,4 +1,4 @@ - diff --git a/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.ts b/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.ts index 9a6d04a2..36b30cd7 100644 --- a/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.ts +++ b/src/app/components/project-map/context-menu/actions/edit-style-action/edit-style-action.component.ts @@ -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, {