[freebase-suggest commit] r99 - trunk/src

1 view
Skip to first unread message

codesite...@google.com

unread,
Jun 17, 2008, 3:38:28 PM6/17/08
to freebase...@googlegroups.com
Author: bobbyrullo
Date: Tue Jun 17 12:38:08 2008
New Revision: 99

Modified:
trunk/src/core.js

Log:
put the index of the list item into the list item's data structure so that
consumers of the fb-select event can tell the index of the selected item


Modified: trunk/src/core.js
==============================================================================
--- trunk/src/core.js (original)
+++ trunk/src/core.js Tue Jun 17 12:38:08 2008
@@ -583,7 +583,7 @@
}
var owner = this;
$.each(filtered, function(i, n) {
- $(list).append(owner.create_list_item(n, txt, options));
+ $(list).append(owner.create_list_item(n, txt, options, i));
});

// hook to add additional html elemments and handlers
@@ -606,7 +606,7 @@

p.list_hide_hook = function() {};

-p.create_list_item = function(data, txt, options) {
+p.create_list_item = function(data, txt, options, index) {
var li = $("<li class='fbs-li'></li>")[0];

var trans = this.transform;
@@ -616,6 +616,8 @@
var html = trans.apply(this, [data, txt]);

$(li).append(html);
+
+ data.index = index;

// sometimes data contains text and/or name
if ("text" in data)

Reply all
Reply to author
Forward
0 new messages