mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
swagger: avoid errors when using invalid rapi-doc fragment ids #465
This commit is contained in:
parent
fd1c03b82f
commit
7722748432
1 changed files with 8 additions and 6 deletions
|
@ -803,12 +803,14 @@ function scrollToFragment() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.setTimeout(function(){
|
window.setTimeout(function(){
|
||||||
|
try{
|
||||||
var e = document.querySelector( window.location.hash );
|
var e = document.querySelector( window.location.hash );
|
||||||
if( e && e.scrollIntoView ){
|
if( e && e.scrollIntoView ){
|
||||||
e.scrollIntoView({
|
e.scrollIntoView({
|
||||||
block: 'start',
|
block: 'start',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} catch( e ){}
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue