minor fix in maker serivce

This commit is contained in:
Roman Hotsiy 2017-01-23 17:08:32 +02:00
parent e164590fca
commit 21a3ab0b1f
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ export class Marker {
newMarkerAtMenuItem(idx:number) {
let context = this.menu.getEl(idx);
if (this.menu.isTagItem(idx)) {
if (this.menu.isTagOrGroupItem(idx)) {
context = this.menu.getTagInfoEl(idx);
}
let newInst = context && new Mark(context);

View File

@ -158,13 +158,13 @@ export class MenuService {
return selector ? document.querySelector(selector) : null;
}
isTagItem(flatIdx: number):boolean {
isTagOrGroupItem(flatIdx: number):boolean {
let item = this.flatItems[flatIdx];
return item && item.metadata && item.metadata.type === 'tag';
return item && (item.isGroup || (item.metadata && item.metadata.type === 'tag'));
}
getTagInfoEl(flatIdx: number):Element {
if (!this.isTagItem(flatIdx)) return null;
if (!this.isTagOrGroupItem(flatIdx)) return null;
let el = this.getEl(flatIdx);
return el && el.querySelector('.tag-info');