Add menu background

This commit is contained in:
Willem Dantuma
2020-01-08 11:37:37 +01:00
parent c52497af59
commit d3bc921000
9 changed files with 135 additions and 88 deletions

View File

@@ -1,40 +1,46 @@
import { Injectable } from '@angular/core';
import {IItemTypes} from '../models/item.types'
import {IItem} from '../models/item'
import {ItemService} from '../services/item.service';
@Injectable({
providedIn: 'root',
})
export class ItemTypeService {
public itemTypes: IItemTypes;
constructor(itemService:ItemService) {
itemService.getItemTypes().subscribe((itemTypes) => {
this.itemTypes = itemTypes;
});
}
getIcon(itemType: string) {
var icon = "fa fa-file-o";
if (this.itemTypes[itemType]) icon = this.itemTypes[itemType].icon;
return icon;
}
getColor(itemType: string) {
var color = "#000000";
if (this.itemTypes[itemType]) color = this.itemTypes[itemType].iconColor;
return color;
}
hasViewer(item: IItem) {
let itemType: string = item.itemType;
if (this.itemTypes[itemType]) return this.itemTypes[itemType].viewer !== undefined;
return false;
}
isLayer(item: IItem) {
let itemType: string = item.itemType;
return itemType == "vnd.farmmaps.itemtype.geotiff.processed" || itemType == "vnd.farmmaps.itemtype.layer" || itemType == "vnd.farmmaps.itemtype.shape.processed";
}
import { Injectable } from '@angular/core';
import {IItemTypes} from '../models/item.types'
import {IItem} from '../models/item'
import {ItemService} from '../services/item.service';
@Injectable({
providedIn: 'root',
})
export class ItemTypeService {
public itemTypes: IItemTypes;
constructor(itemService:ItemService) {
itemService.getItemTypes().subscribe((itemTypes) => {
this.itemTypes = itemTypes;
});
}
getIcon(itemType: string) {
var icon = "fa fa-file-o";
if (this.itemTypes[itemType]) icon = this.itemTypes[itemType].icon;
return icon;
}
getColor(itemType: string) {
var color = "#000000";
if (this.itemTypes[itemType]) color = this.itemTypes[itemType].iconColor;
return color;
}
hasViewer(item: IItem) {
let itemType: string = item.itemType;
if (this.itemTypes[itemType]) return this.itemTypes[itemType].viewer !== undefined;
return false;
}
hasEditor(item: IItem) {
let itemType: string = item.itemType;
if (this.itemTypes[itemType]) return this.itemTypes[itemType].editor !== undefined;
return false;
}
isLayer(item: IItem) {
let itemType: string = item.itemType;
return itemType == "vnd.farmmaps.itemtype.geotiff.processed" || itemType == "vnd.farmmaps.itemtype.layer" || itemType == "vnd.farmmaps.itemtype.shape.processed";
}
}