Add menu background
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user