Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep the order about a current class position #3

Open
davidshimjs opened this issue Jan 13, 2014 · 2 comments
Open

Keep the order about a current class position #3

davidshimjs opened this issue Jan 13, 2014 · 2 comments

Comments

@davidshimjs
Copy link
Owner

A Class that showed at current page will be shown by scrolling instead of changing order at navigation area.

@sttk
Copy link

sttk commented Sep 4, 2014

I want it, too.
And I suggest an appropriate modification to solve this issue.
Modify main.js as follows:

32,44d31
<     // Show an item related a current documentation automatically
<     var filename = $('.page-title').data('filename').replace(/\.[a-z]+$/, '');
<     var $currentItem = $('.navigation .item[data-name*="' + filename + '"]:eq(0)');
< 
<     if ($currentItem.length) {
<         $currentItem
<             .remove()
<             .prependTo('.navigation .list')
<             .show()
<             .find('.itemMembers')
<                 .show();
<     }
< 
69c56,70
< });
---
> 
>     // Show an item related a current documentation automatically
>     var filename = $('.page-title').data('filename').replace(/\.[a-z]+$/, '');
>     var $linkItem = $('.navigation .item .title a[href="' + filename + '.html"]:eq(0)');
> 
>     if ($linkItem.length) {
>         var $currentItem = $linkItem.parent().parent();
>         $currentItem.find('.itemMembers').show();
> 
>         var $list = $('.navigation .list');
>         var $firstItem = $list.find('.item:eq(0)');
>         $list.scrollTop($currentItem.offset().top - $firstItem.offset().top);
>     }
> 
> });

@serginator
Copy link

+1 on this, it's really annoying to have the links redistributed on each click.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants