]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/media/js/osqa.admin.js
Merging the experimental branch back to trunk.
[osqa.git] / forum / skins / default / media / js / osqa.admin.js
1 $(function() {\r
2     $('.string_list_widget_button').live('click', function() {\r
3         $but = $(this);\r
4 \r
5         if ($but.is('.add')) {\r
6             $new = $("<div style=\"display: none\">" +\r
7                     "<input type=\"text\" name=\"" + $but.attr('name') + "\" value=\"\" />" +\r
8                     "<button class=\"string_list_widget_button\">-</button>" +\r
9                     "</div>");\r
10 \r
11             $but.before($new);\r
12             $new.slideDown('fast');\r
13         } else {\r
14             $but.parent().slideUp('fast', function() {\r
15                 $but.parent().remove();\r
16             });\r
17         }\r
18 \r
19         return false;\r
20     })\r
21 });