mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 18:43:43 +03:00
fix: undo section id + some minor fixes
This commit is contained in:
parent
b7f0a1a4c4
commit
0253c5d76d
|
@ -59,12 +59,11 @@ export class ContentItem extends React.Component<ContentItemProps> {
|
|||
export class TagItem extends React.Component<ContentItemProps> {
|
||||
render() {
|
||||
const { name, description } = this.props.item;
|
||||
const hash = this.props.item.getHash();
|
||||
return (
|
||||
<Row>
|
||||
<MiddlePanel key="middle">
|
||||
<H1 id={hash}>
|
||||
<ShareLink href={'#' + hash} />
|
||||
<H1>
|
||||
<ShareLink href={'#' + this.props.item.getHash()} />
|
||||
{name}
|
||||
</H1>
|
||||
{description !== undefined && <Markdown source={description} />}
|
||||
|
|
|
@ -44,12 +44,11 @@ export class Operation extends ComponentWithOptions<OperationProps> {
|
|||
|
||||
const { name: summary, description, deprecated } = operation;
|
||||
const pathInMiddle = this.options.pathInMiddlePanel;
|
||||
const hash = operation.getHash();
|
||||
return (
|
||||
<OperationRow>
|
||||
<MiddlePanel>
|
||||
<H2 id={hash}>
|
||||
<ShareLink href={'#' + hash} />
|
||||
<H2>
|
||||
<ShareLink href={'#' + operation.getHash()} />
|
||||
{summary} {deprecated && <Badge type="warning"> Deprecated </Badge>}
|
||||
</H2>
|
||||
{pathInMiddle && <Endpoint operation={operation} inverted={true} />}
|
||||
|
|
|
@ -25,6 +25,10 @@ export class Redoc extends React.Component<RedocProps> {
|
|||
this.props.store.menu.updateOnHash();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.store.dispose();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { store: { spec, menu, options } } = this.props;
|
||||
const store = this.props.store;
|
||||
|
|
|
@ -82,7 +82,7 @@ export class SecurityDefs extends React.PureComponent<SecurityDefsProps> {
|
|||
<div>
|
||||
{this.props.securitySchemes.schemes.map(scheme => (
|
||||
<div data-section-id={scheme.sectionId} key={scheme.id}>
|
||||
<H2 id={scheme.sectionId}>
|
||||
<H2>
|
||||
<ShareLink href={'#' + scheme.sectionId} />
|
||||
{scheme.id}
|
||||
</H2>
|
||||
|
|
|
@ -16,7 +16,7 @@ export class SideMenu extends ComponentWithOptions<{ menu: MenuStore }> {
|
|||
<MenuItems
|
||||
style={{
|
||||
overflow: 'auto',
|
||||
'-ms-overflow-style': '-ms-autohiding-scrollbar',
|
||||
msOverflowStyle: '-ms-autohiding-scrollbar',
|
||||
}}
|
||||
items={store.items}
|
||||
onActivate={this.activate}
|
||||
|
|
|
@ -133,7 +133,9 @@ export class MenuStore {
|
|||
return (item as OperationModel).operationId === ptr;
|
||||
});
|
||||
}
|
||||
if (item) {
|
||||
this.activateAndScroll(item, false);
|
||||
}
|
||||
return item !== undefined;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user