serializeTags: include the tag itself into trace
authorAlexey Andriyanov <alan@al-an.info>
Sat, 11 Jan 2014 19:20:34 +0000 (23:20 +0400)
committerAlexey Andriyanov <alan@al-an.info>
Fri, 17 Jan 2014 10:44:09 +0000 (14:44 +0400)
wwwroot/inc/interface-lib.php
wwwroot/js/tag-it-local.js

index a41ab4404c9bcef03100c5f423218dd62c674a2a..6ddc91ee751249f94e90b7648c5101dc24e833e7 100644 (file)
@@ -778,15 +778,15 @@ function serializeTags ($chain, $baseurl = '')
                        $title = htmlspecialchars ($taginfo['user'] . ', ' . formatAge ($taginfo['time']), ENT_QUOTES);
                if (isset($taginfo['parent_id']))
                {
-                       $tag_trace = $taglist[$taginfo['id']]['trace'];
-                       $parent_info = array ();
-                       foreach ($tag_trace as $tag_id)
+                       $parent_info = array();
+                       foreach ($taglist[$taginfo['id']]['trace'] as $tag_id)
                                $parent_info[] = $taglist[$tag_id]['tag'];
-                       if ($title)
+                       $parent_info[] = $taginfo['tag'];
+                       if (strlen ($title))
                                $title .= "\n";
                        $title .= implode (" \xE2\x86\x92  ", $parent_info); # right arrow
                }
-               if ($title)
+               if (strlen ($title))
                        $title = "title='$title'";
 
                $class = '';
index e1c8eaeca71c9e0f3e6465d362f5a143130582bc..01023b701f8ca9f1c90510b3744618ee7b0dc820 100644 (file)
@@ -153,6 +153,7 @@ function generateTagList(input, ul, taglist, preselect, value_name, tag_limit, e
                {
                        s.push(tags_to_name[tag_trace[k]]);
                }
+               s.push(tag);
                var result = s.join(" \u2192 "); // right arrow
                return result;
        }