mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-29 17:40:05 +03:00
Merge remote-tracking branch 'origin/master' into feat/add-reference-to-api-on-schema
This commit is contained in:
commit
77aa71133f
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "redoc",
|
"name": "redoc",
|
||||||
"version": "2.0.0-0.1.1",
|
"version": "2.0.0-0.2.0",
|
||||||
"description": "ReDoc",
|
"description": "ReDoc",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -72,6 +72,9 @@ export class AppStore {
|
||||||
// update position statically based on hash (in case of SSR)
|
// update position statically based on hash (in case of SSR)
|
||||||
MenuStore.updateOnHistory(this.history.currentId, this.scroll);
|
MenuStore.updateOnHistory(this.history.currentId, this.scroll);
|
||||||
|
|
||||||
|
// Listen for external event to update
|
||||||
|
window.addEventListener('redocUpdatePosition', this.updateOnEvent);
|
||||||
|
|
||||||
// override the openApi standard to version 3.1.0
|
// override the openApi standard to version 3.1.0
|
||||||
// TODO remove when fully supporting open API 3.1.0
|
// TODO remove when fully supporting open API 3.1.0
|
||||||
spec.openapi = '3.1.0';
|
spec.openapi = '3.1.0';
|
||||||
|
@ -98,6 +101,7 @@ export class AppStore {
|
||||||
dispose() {
|
dispose() {
|
||||||
this.scroll.dispose();
|
this.scroll.dispose();
|
||||||
this.menu.dispose();
|
this.menu.dispose();
|
||||||
|
window.removeEventListener('redocUpdatePosition', this.updateOnEvent);
|
||||||
if (this.search) {
|
if (this.search) {
|
||||||
this.search.dispose();
|
this.search.dispose();
|
||||||
}
|
}
|
||||||
|
@ -125,6 +129,10 @@ export class AppStore {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private updateOnEvent(): void {
|
||||||
|
MenuStore.updateOnHistory(this.history.currentId, this.scroll);
|
||||||
|
}
|
||||||
|
|
||||||
private updateMarkOnMenu(idx: number) {
|
private updateMarkOnMenu(idx: number) {
|
||||||
const start = Math.max(0, idx);
|
const start = Math.max(0, idx);
|
||||||
const end = Math.min(this.menu.flatItems.length, start + 5);
|
const end = Math.min(this.menu.flatItems.length, start + 5);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user