AW-823 implementcorrect editor navigation
This commit is contained in:
parent
ab99f6722c
commit
f21648386b
@ -15,19 +15,21 @@ export abstract class AbstractSelectedItemComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleOnView(item: IItem) {
|
handleOnView(item: IItem) {
|
||||||
var itemType = this.itemTypeService.itemTypes[item.itemType];
|
if (this.itemTypeService.hasViewer(item)) {
|
||||||
if (itemType) {
|
let viewer = this.itemTypeService.itemTypes[item.itemType];
|
||||||
if (itemType.viewer) {
|
let url = `/viewer/${viewer}/item/${item.code}`;
|
||||||
let url = `/viewer/${itemType.viewer}/item/${item.code}`;
|
this.router.navigate([url]);
|
||||||
this.router.navigate([url]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOnEdit(item: IItem) {
|
handleOnEdit(item: IItem) {
|
||||||
let url = `/editor/property/item/${item.code}`;
|
var editor = "property";
|
||||||
this.router.navigate([url]);
|
if(this.itemTypeService.hasEditor(item)) {
|
||||||
|
editor = this.itemTypeService.itemTypes[item.itemType].editor;
|
||||||
|
}
|
||||||
|
let url = `/editor/${editor}/item/${item.code}`
|
||||||
|
this.router.navigate([url]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user