Skip to content

Commit

Permalink
Merge pull request #242 from kaola-fed/feature_sidebar_scroll_20170829
Browse files Browse the repository at this point in the history
文档的菜单增加滚动功能
  • Loading branch information
nupthale authored Aug 29, 2017
2 parents 1df68eb + 79bf4ea commit 2d6fefb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion doc/themes/nekui/layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,16 @@

<!-- fastclick -->
<script src="//cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js"></script>
<script src="/js/scrollIntoView.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body)
FastClick.attach(document.body);
scrollIntoView(document.querySelector('.sidebar .submenu a.current'), {
validTarget: function(target, parentsScrolled){
return parentsScrolled < 2 && target !== window && target.matches('.sidebar');
},
});
}, false)
</script>
</body>
Expand Down
7 changes: 7 additions & 0 deletions doc/themes/nekui/source/js/scrollIntoView.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2d6fefb

Please sign in to comment.