jaguarjs-jsdoc icon indicating copy to clipboard operation
jaguarjs-jsdoc copied to clipboard

Keep the order about a current class position

Open davidshimjs opened this issue 11 years ago • 2 comments

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

davidshimjs avatar Jan 13 '14 08:01 davidshimjs

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);
>     }
> 
> });

sttk avatar Sep 04 '14 16:09 sttk

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

serginator avatar Feb 23 '15 11:02 serginator