gbcoinbank.js 510 Bytes
$(function(){
	if($("#data-coinhistory-tmpl").length){
		var map = {creationdate:''};			
		identityService.findAllCoinByUid(global_onlineuser.uid, {
			callback:function(gbdata){
				var template = Handlebars.compile($("#data-coinhistory-tmpl").html()), 
				        	history = template(gbdata);
				$('#gbcoinhistory').html(history);
				
				var totalcoin=0;
				for(var i=0;i<gbdata.length;i++){
					totalcoin+=gbdata[i].coin;
				}
				$('#totalcoin').html(totalcoin);
			}
		});
	}  
});