Skip to content

Commit 6f9baab

Browse files
authored
style: Update index.html and scroll.js (#1292)
1 parent 667496b commit 6f9baab

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

docs/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
'/': 'Search'
6363
}
6464
},
65-
formatUpdated: '{MM}/{DD} {HH}:{mm}',
6665
plugins: [
6766
function (hook, vm) {
6867
hook.beforeEach(function (html) {

index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<link rel="stylesheet" href="/themes/vue.css" title="vue">
1010
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
1111
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
12+
<link rel="stylesheet" href="/themes/pure.css" title="pure" disabled>
1213
<style>
1314
nav.app-nav li ul {
1415
min-width: 100px;
@@ -52,7 +53,6 @@
5253
'/': 'Search'
5354
}
5455
},
55-
formatUpdated: '{MM}/{DD} {HH}:{mm}',
5656
plugins: [
5757
function (hook, vm) {
5858
hook.beforeEach(function (html) {
@@ -68,7 +68,6 @@
6868
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
6969
}
7070
var editHtml = '[:memo: Edit Document](' + url + ')\n'
71-
7271
return editHtml
7372
+ html
7473
+ '\n\n----\n\n'
@@ -82,9 +81,10 @@
8281
<script src="/lib/plugins/search.js"></script>
8382
<script src="/lib/plugins/emoji.js"></script>
8483
<script src="/lib/plugins/front-matter.js"></script>
85-
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
86-
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
87-
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
84+
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
85+
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
86+
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-nginx.min.js"></script>
87+
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-php.min.js"></script>
8888
</body>
8989

9090
</html>

src/core/event/scroll.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@ function highlight(path) {
7979
const isInView =
8080
active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height;
8181
const notThan = cur - curOffset < height;
82-
const top = isInView ? wrap.scrollTop : notThan ? curOffset : cur - height;
8382

84-
sidebar.scrollTop = top;
83+
sidebar.scrollTop = isInView
84+
? wrap.scrollTop
85+
: notThan
86+
? curOffset
87+
: cur - height;
8588
}
8689
}
8790

0 commit comments

Comments
 (0)