javascript/taggr.js
changeset 25 4b3cf12848c2
parent 24 001f52cd057e
--- a/javascript/taggr.js	Sun Jan 20 01:07:02 2008 +0000
+++ b/javascript/taggr.js	Sun Jan 20 01:52:00 2008 +0000
@@ -99,6 +99,10 @@
 }
 
 function new_tag (tag_name) {
+    if ($("tag_" + tag_name)) {
+        $("tag_" + tag_name).show().scrollTo();
+    }
+
     var tag_images = Builder.node("td", {className:"tag_images", id:"tag_" + tag_name + "_images"});
 
     tag_images._tag = tag_name;
@@ -116,6 +120,8 @@
     tag_row._tags = new Array(tag_name);
 
     $("tag_table").appendChild(tag_row);
+
+    return true;
 }
 
 function tag_add_tag (new_tag, tag) {
@@ -177,7 +183,7 @@
             parameters: {
                 act: 'tag',
                 img: orig_img._key,
-                tag: tag,
+                tag: $("tag_" + tag)._tags,
             },
             method: 'get'
 
@@ -198,7 +204,7 @@
         parameters: {
             act: 'tag',
             img: img_keys,
-            tag: tag_name,
+            tag: $("tag_" + tag_name)._tags,
         },
         method: 'get'
 
@@ -218,21 +224,21 @@
         parameters: {
             act: 'untag',
             img: img_key,
-            tag: tag_name,
+            tag: $("tag_" + tag_name)._tags,
         },
         method: 'get',
     });
 }
 
 function hide_tag_image (tag, img) {
-    $("tagimg_" + tag + "_" + img).hide();
+    $("tag_" + tag + "_img_" + img).hide();
 
     if (--$("tag_" + tag + "_images")._visibleCount == 0)
         $("tag_" + tag).hide();
 }
 
 function show_tag_image (tag, img) {
-    $("tagimg_" + tag + "_" + img).hide();
+    $("tag_" + tag + "_img_" + img).show();
 
     if ($("tag_" + tag + "_images")._visibleCount++ == 0)
          $("tag_" + tag).show();