Skip to content

Commit 4460268

Browse files
cpriestblakeembrey
authored andcommitted
Add source reflection to NavigationItem (#507)
1 parent 9c0cd44 commit 4460268

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lib/output/models/NavigationItem.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,26 @@ export class NavigationItem {
6363
*/
6464
isInPath: boolean;
6565

66+
/**
67+
* The source [Reflection] this item is built from
68+
*/
69+
reflection: Reflection;
70+
6671
/**
6772
* Create a new NavigationItem instance.
6873
*
6974
* @param title The visible title of the navigation node.
7075
* @param url The url this navigation node points to.
7176
* @param parent The parent navigation node.
7277
* @param cssClasses A string containing the css classes of this node.
78+
* @param reflection The source [Reflection] for this [NavigationItem]
7379
*/
74-
constructor(title?: string, url?: string, parent?: NavigationItem, cssClasses?: string) {
80+
constructor(title?: string, url?: string, parent?: NavigationItem, cssClasses?: string, reflection?: Reflection) {
7581
this.title = title || '';
7682
this.url = url || '';
7783
this.parent = parent || null;
7884
this.cssClasses = cssClasses || '';
85+
this.reflection = reflection;
7986

8087
if (!url) {
8188
this.isLabel = true;
@@ -109,6 +116,6 @@ export class NavigationItem {
109116
name = `<em>${reflection.kindString}</em>`;
110117
}
111118

112-
return new NavigationItem(name, reflection.url, parent, reflection.cssClasses);
119+
return new NavigationItem(name, reflection.url, parent, reflection.cssClasses, reflection);
113120
}
114121
}

0 commit comments

Comments
 (0)