From 21a3ab0b1fa0751b7fad0e0428eb96101cfa5676 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 23 Jan 2017 17:08:32 +0200 Subject: [PATCH] minor fix in maker serivce --- lib/services/marker.service.ts | 2 +- lib/services/menu.service.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/services/marker.service.ts b/lib/services/marker.service.ts index bc42a725..cc4a537b 100644 --- a/lib/services/marker.service.ts +++ b/lib/services/marker.service.ts @@ -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); diff --git a/lib/services/menu.service.ts b/lib/services/menu.service.ts index cdc8f64f..ab959a6f 100644 --- a/lib/services/menu.service.ts +++ b/lib/services/menu.service.ts @@ -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');