Skip to content

Commit

Permalink
style: Update index.html and scroll.js (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records authored Jul 20, 2020
1 parent 667496b commit 6f9baab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
'/': 'Search'
}
},
formatUpdated: '{MM}/{DD} {HH}:{mm}',
plugins: [
function (hook, vm) {
hook.beforeEach(function (html) {
Expand Down
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="/themes/vue.css" title="vue">
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
<link rel="stylesheet" href="/themes/pure.css" title="pure" disabled>
<style>
nav.app-nav li ul {
min-width: 100px;
Expand Down Expand Up @@ -52,7 +53,6 @@
'/': 'Search'
}
},
formatUpdated: '{MM}/{DD} {HH}:{mm}',
plugins: [
function (hook, vm) {
hook.beforeEach(function (html) {
Expand All @@ -68,7 +68,6 @@
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
}
var editHtml = '[:memo: Edit Document](' + url + ')\n'

return editHtml
+ html
+ '\n\n----\n\n'
Expand All @@ -82,9 +81,10 @@
<script src="/lib/plugins/search.js"></script>
<script src="/lib/plugins/emoji.js"></script>
<script src="/lib/plugins/front-matter.js"></script>
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-nginx.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-php.min.js"></script>
</body>

</html>
7 changes: 5 additions & 2 deletions src/core/event/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ function highlight(path) {
const isInView =
active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height;
const notThan = cur - curOffset < height;
const top = isInView ? wrap.scrollTop : notThan ? curOffset : cur - height;

sidebar.scrollTop = top;
sidebar.scrollTop = isInView
? wrap.scrollTop
: notThan
? curOffset
: cur - height;
}
}

Expand Down

1 comment on commit 6f9baab

@vercel
Copy link

@vercel vercel bot commented on 6f9baab Jul 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.