[Jifty-commit] r5322 - jifty/trunk/share/web/static/js

Jifty commits jifty-commit at lists.jifty.org
Thu Apr 17 08:32:46 EDT 2008


Author: clkao
Date: Thu Apr 17 08:32:46 2008
New Revision: 5322

Modified:
   jifty/trunk/share/web/static/js/jifty_interface.js

Log:
bandaid for autocompleter to deal with spans in li.


Modified: jifty/trunk/share/web/static/js/jifty_interface.js
==============================================================================
--- jifty/trunk/share/web/static/js/jifty_interface.js	(original)
+++ jifty/trunk/share/web/static/js/jifty_interface.js	Thu Apr 17 08:32:46 2008
@@ -26,8 +26,16 @@
 
 			subject.autoCFG.lastSuggestion.each(
 			    function(nr) {
+                                // XXX: we should be looking at span.hidden_value, but it doesn't exist... 
                                 var v = jQuery(this).text();
-				toWrite += '<li rel="' + v + '" dir="' + nr + '" style="cursor: default;">' + v + '</li>';
+                                var value = v;
+                                if (jQuery('span:last', this).size()) {
+                                    value = jQuery('span:last', this).text();
+                                    // XXX for some reasons .html() / innerHTML is empty though we have .text() working, so reconstruct the bloody html
+                                    v = '<span class="informal">'+jQuery('span:first', this).text()+'</span>'+'<span class="hidden_value">'+jQuery('span:last', this).text()+'</span>';
+                                }
+
+				toWrite += '<li rel="' + value + '" dir="' + nr + '" style="cursor: default;">' + v + '</li>';
 			    }
 			);
                         


More information about the Jifty-commit mailing list