fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-11-04 05:50 am

[dw-free] Revamp /update

[commit: http://hg.dwscoalition.org/dw-free/rev/8c1f8fad1e92]

http://bugs.dwscoalition.org/show_bug.cgi?id=2524

Fix issue with tags with apostrophes being truncated when selected from the
tags browser.

Patch by [personal profile] fu.

Files modified:
  • htdocs/js/jquery.tagselector.js
--------------------------------------------------------------------------------
diff -r 2cd10f6e1e66 -r 8c1f8fad1e92 htdocs/js/jquery.tagselector.js
--- a/htdocs/js/jquery.tagselector.js	Thu Nov 03 10:03:54 2011 -0500
+++ b/htdocs/js/jquery.tagselector.js	Fri Nov 04 12:34:07 2011 +0800
@@ -135,8 +135,10 @@
         var $tagslist = $("<ul id='tagselector_tags_list'></ul>");
 
         $.each(data, function(index, value) {
-            var checked = selected[value] ? "checked='checked'" : "";
-            $("<li><input type='checkbox' id='tagselector_tag_"+value+"' value='"+value+"' "+checked+"/><label for='tagselector_tag_"+value+"'>"+value+"</label></li>").appendTo($tagslist);
+            $("<li>").append(
+                $( "<input>", { type: "checkbox", id: "tagselector_tag_" + value, value: value, checked: selected[value] } ),
+                $("<label>", { for: "tagselector_tag_" + value } ).text(value) )
+            .appendTo($tagslist)
         });
 
         $("#tagselector_tags").empty().append($tagslist);
--------------------------------------------------------------------------------