Commits

Shlomi Fish  committed cba5cb2

Embolden the current URL.

  • Participants
  • Parent commits 35233a7

Comments (0)

Files changed (3)

 * jqTree
     - Implement a more permanent (and lib/MyNavData.pm-side) ID-generation
     scheme for the saveState).
-
-* jqTree
     - convert the JS wrapper functions from using a full path to using a
     relative path.
         - cut the middle man.
+    - make the current URL bold.

File Tests/js/jqtree-from-h-w-json-nav-menu-test.js

                 },
                 {
                     id: 3,
-                    label: '<a href="./../humour/" title="Stories and Aphorisms I wrote">Humour</a>'
+                    label: '<b>Humour</b>'
                 }
                 ],
             },

File common/js/to-jqtree.js

         if ('title' in sub_tree) {
             title_attr = ' title="' + sub_tree['title'] + '"'
         }
+
+        var label = (sub_tree['url'] == rel_path)
+            ? "<b>" + sub_tree['text'] + "</b>"
+            : ("<a href=\"" +
+                escape_html(_get_rel(sub_tree['url'])) + "\"" + title_attr +
+                ">" + sub_tree['text'] + "</a>"
+                );
+
         var ret = {
             id: parseInt(sub_tree['id']),
-            label: ("<a href=\"" +
-                escape_html(_get_rel(sub_tree['url'])) + "\"" + title_attr +
-                ">" + sub_tree['text'] + "</a>"
-                )
+            label: label
         };
 
         if ('subs' in sub_tree) {