forked from MapComplete/MapComplete
Add ToC to generated pages
This commit is contained in:
parent
b4529e4f63
commit
752538ec14
18 changed files with 346 additions and 243 deletions
|
@ -47,18 +47,10 @@ export default class Combine extends BaseUIElement {
|
|||
return el;
|
||||
}
|
||||
|
||||
public getToC(): Title[]{
|
||||
const titles = []
|
||||
for (const uiElement of this.uiElements) {
|
||||
if(uiElement instanceof Combine){
|
||||
titles.push(...uiElement.getToC())
|
||||
}else if(uiElement instanceof Title){
|
||||
titles.push(uiElement)
|
||||
}
|
||||
}
|
||||
return titles
|
||||
|
||||
|
||||
public getElements(): BaseUIElement[]{
|
||||
return this.uiElements
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue