nitdoc: make the menu follows the scroll.
[nit.git] / share / nitdoc / scripts / js-facilities.js
index 7911cb8..0c9f42b 100644 (file)
@@ -20,12 +20,12 @@ var currentIndex = -1;
 * Add folding and filtering facilities to class description page.\r
 */\r
 $(document).ready(function() {\r
-\r
+       \r
        /*\r
        * Highlight the spoted element\r
        */\r
-       highlightBlock(currentAnchor());
-       \r
+       highlightBlock(currentAnchor());\r
+\r
        /*\r
        * Nav block folding\r
        */\r
@@ -226,14 +226,6 @@ $(document).ready(function() {
                }\r
         });\r
        \r
-       /*\r
-       * Anchors jumps\r
-       */\r
-       $("a[href^='#']").click( function() {\r
-               var a = $(this).attr("href").replace(/#/, "");\r
-               highlightBlock(a);\r
-       });\r
-       \r
        // Insert filter field\r
        $("article.filterable h2, nav.filterable h3")\r
        .after(\r
@@ -349,9 +341,16 @@ $(document).ready(function() {
                        \r
                        $(this).toggleClass("hidden");\r
                })\r
-       );
-       
-       //Preload filter fields with query string
+       );\r
+\r
+       /*\r
+       * Anchors jumps\r
+       */\r
+       $("a[href*='#']").click( function() {\r
+               highlightBlock($(this).attr("href").split(/#/)[1]);\r
+       });\r
+       \r
+       //Preload filter fields with query string\r
        preloadFilters();\r
 });\r
 \r