Browse Source
Fix anchor navigation and Toc init in vs.js
pull/24069/head
maliming
11 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
8 additions and
1 deletions
-
modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js
|
|
|
@ -40,11 +40,13 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
hash = hash.split('&')[0]; |
|
|
|
|
|
|
|
var $targetElement = $(decodeURIComponent(hash)); |
|
|
|
|
|
|
|
$targetElement = $targetElement.length |
|
|
|
? $targetElement |
|
|
|
: $('[name=' + this.hash.slice(1) + ']'); |
|
|
|
: $('[name=' + hash.slice(1) + ']'); |
|
|
|
|
|
|
|
if (!$targetElement.length) { |
|
|
|
return; |
|
|
|
@ -64,6 +66,11 @@ |
|
|
|
handleCustomScrolls(); |
|
|
|
|
|
|
|
var $myNav = $('#docs-sticky-index'); |
|
|
|
|
|
|
|
if ($myNav.length === 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
Toc.init($myNav); |
|
|
|
|
|
|
|
$('body').scrollspy({ |
|
|
|
|