mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-10 08:12:23 +03:00
Merge pull request #24 from Bandwidth/tags
Update Tag Groups to be Collapsible
This commit is contained in:
commit
4f6935bce8
|
@ -53,7 +53,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
||||||
{item.sidebarLabel}
|
{item.sidebarLabel}
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</MenuItemTitle>
|
</MenuItemTitle>
|
||||||
{(item.depth > 0 && item.items.length > 0 && (
|
{(item.items.length > 0 && (
|
||||||
<ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} />
|
<ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} />
|
||||||
)) ||
|
)) ||
|
||||||
null}
|
null}
|
||||||
|
|
|
@ -56,9 +56,9 @@ export class GroupModel implements IMenuItem {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.externalDocs = (tagOrGroup as OpenAPITag).externalDocs;
|
this.externalDocs = (tagOrGroup as OpenAPITag).externalDocs;
|
||||||
|
|
||||||
// groups are active (expanded) by default
|
// groups are active but not expanded by default
|
||||||
if (this.type === 'group') {
|
if (this.type === 'group') {
|
||||||
this.expanded = true;
|
this.active = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +77,6 @@ export class GroupModel implements IMenuItem {
|
||||||
|
|
||||||
@action
|
@action
|
||||||
collapse() {
|
collapse() {
|
||||||
// disallow collapsing groups
|
|
||||||
if (this.type === 'group') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.expanded = false;
|
this.expanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user