mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-30 04:23:44 +03:00
fix: clear page fragment when scroll to the beginning
This commit is contained in:
parent
7b19417497
commit
929740ab28
|
@ -28,7 +28,7 @@ export class Hash {
|
||||||
}
|
}
|
||||||
|
|
||||||
update(hash: string|null) {
|
update(hash: string|null) {
|
||||||
if (!hash) return;
|
if (hash == undefined) return;
|
||||||
this.noEmit = true;
|
this.noEmit = true;
|
||||||
window.location.hash = hash;
|
window.location.hash = hash;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
@ -208,7 +208,10 @@ export class MenuService {
|
||||||
|
|
||||||
this.deactivate(this.activeIdx);
|
this.deactivate(this.activeIdx);
|
||||||
this.activeIdx = idx;
|
this.activeIdx = idx;
|
||||||
if (idx < 0) return;
|
if (idx < 0) {
|
||||||
|
this.hash.update('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
item.active = true;
|
item.active = true;
|
||||||
|
|
||||||
|
@ -409,7 +412,7 @@ export class MenuService {
|
||||||
checkAllTagsUsedInGroups() {
|
checkAllTagsUsedInGroups() {
|
||||||
for (let tag of Object.keys(this._tagsWithMethods)) {
|
for (let tag of Object.keys(this._tagsWithMethods)) {
|
||||||
if (!this._tagsWithMethods[tag].used) {
|
if (!this._tagsWithMethods[tag].used) {
|
||||||
WarningsService.warn(`Tag "${tag}" is not added to any group`)
|
WarningsService.warn(`Tag "${tag}" is not added to any group`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user