diff options
Diffstat (limited to 'Resources/friendship/ui/LikeList.js')
| -rw-r--r-- | Resources/friendship/ui/LikeList.js | 26 | 
1 files changed, 17 insertions, 9 deletions
| diff --git a/Resources/friendship/ui/LikeList.js b/Resources/friendship/ui/LikeList.js index be81747..f46ba55 100644 --- a/Resources/friendship/ui/LikeList.js +++ b/Resources/friendship/ui/LikeList.js @@ -123,7 +123,7 @@  			top:item_type.height + 2,  			left: profile_icon.width + 14,  			height:'auto', -			wordWrap:'true' +			wordWrap:false  		});  		var liked_by = Ti.UI.createLabel({ @@ -189,11 +189,8 @@  	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; -			} +		if (uid.toString() in fs.data.friends) { +			result = fs.data.friends[uid.toString()].name;  		}  		return result;  	}; @@ -210,7 +207,11 @@  		//Ti.App.fireEvent('app:show.loader');  		Ti.API.addEventListener("processFriendIDs", function(e) { -			fs.data.friends = e.data; +			fs.data.friends = Array(); +			for (var i = 0; i < e.data.length; i++) { +				fs.data.friends[e.data[i].uid.toString()] = {uid: e.data[i].uid, pic: e.data[i].pic_square, name: e.data[i].name, selected: true}; +			} +			  			fs.core.queryAllFriendLikeIDsFQL();  		}); @@ -296,10 +297,17 @@  		return ll_view;  	}; -	fs.ui.refreshLikeList = function(e) { +	fs.ui.refreshAllFriendsLikeList = function(e) { +		if (Ti.Facebook.loggedIn) { +			Ti.App.fireEvent('app:show.loader'); +			fs.core.queryFriendIDsFQL(); +		} +	}; + +	fs.ui.refreshLikeList = function(friend_ids) {  		if (Ti.Facebook.loggedIn) {  			Ti.App.fireEvent('app:show.loader'); -			fs.core.queryAllFriendLikeIDsFQL(); // TODO: switch to friend_ids version of query +			fs.core.queryLikeIDsFQL(friend_ids);  		}  	};  })(); | 
