mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
minor fix in maker serivce
This commit is contained in:
parent
e164590fca
commit
21a3ab0b1f
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue
Block a user