aboutsummaryrefslogtreecommitdiffstats
path: root/Resources/friendship/ui/LikeList.js
diff options
context:
space:
mode:
authorAnqi Xu2012-06-24 06:35:26 -0400
committerAnqi Xu2012-06-24 06:35:26 -0400
commit42fda5a3b62d3347847daf3b811c74cc11a9fa73 (patch)
tree85eb3c62c8b85031b723fc0eb35c16eeb96801fb /Resources/friendship/ui/LikeList.js
parent90e6928b34d44b9e2d6f64f807af370e85aac985 (diff)
downloadLikeFeed-42fda5a3b62d3347847daf3b811c74cc11a9fa73.tar.bz2
Updated
Diffstat (limited to 'Resources/friendship/ui/LikeList.js')
-rw-r--r--Resources/friendship/ui/LikeList.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/Resources/friendship/ui/LikeList.js b/Resources/friendship/ui/LikeList.js
index 2dfd46d..8e9f74c 100644
--- a/Resources/friendship/ui/LikeList.js
+++ b/Resources/friendship/ui/LikeList.js
@@ -125,7 +125,7 @@
});
var liked_by = Ti.UI.createLabel({
- text: " Friend Bob ",
+ text: key.friend_name,
font:{fontSize:11,fontWeight:'single'},
//color: 'white',
@@ -183,9 +183,17 @@
return row;
};
+
- function sortLikeIDsByTime(a, b) { // TODO: deprecated
- return ((a.time > b.time) ? -1 : ((a.time < b.time) ? 1 : 0));
+ function friend_name_from_uid(uid) {
+ var result = "???";
+ for (var i = 0; i < fs.data.friends.length; i++) {
+ if (fs.data.friends[i].uid == uid) {
+ result = fs.data.friends[i].name;
+ break;
+ }
+ }
+ return result;
};
fs.ui.createLikeList = function() {
@@ -239,8 +247,7 @@
});
for (var i = 0; i < tuples.length; i++) {
- fs.data.reverseChronoLikedIDs.push(tuples[i][0]);
- //Ti.API.info(tuples[i][0] + ' ' + tuples[i][1].time);
+ fs.data.reverseChronoLikedIDs.push({pid: tuples[i][0], count: tuples[i][1].count, time: tuples[i][1].time, uid: tuples[i][1].uid});
}
fs.data.numLikesFetched = 0;
@@ -257,6 +264,9 @@
Ti.API.addEventListener("processLikes", function(e) {
for ( key in e.data ) {
+
+ e.data[key].more = fs.data.reverseChronoLikedIDs[fs.data.numLikesFetched];
+ e.data[key].friend_name = friend_name_from_uid(e.data[key].more.uid);
fs.data.numLikesFetched++;
ll_view.appendRow(create_row(e.data[key]));
}