Rev 23419 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
var walletHistory = walletHistory || {};walletHistory.startTime="";walletHistory.endTime="";$(function() {$(".wallet_icon_header").live('click', function() {loadWallet("main-content", "", "");});$("#wallet-history-paginated .next").live('click', function() {var start = $( "#wallet-history-paginated .start" ).text();var end = $( "#wallet-history-paginated .end" ).text();getWalletHistoryNextItems(start, end, walletHistory.startTime, walletHistory.endTime);$("#wallet-history-paginated .next").blur();});$("#wallet-history-paginated .previous").live('click', function() {var start = $( "#wallet-history-paginated .start" ).text();var end = $( "#wallet-history-paginated .end" ).text();var pre = end - 20;getWalletHistoryPreviousItems(start, end, pre, walletHistory.startTime, walletHistory.endTime);$("#wallet-history-paginated .previous").blur();});});function getWalletHistoryNextItems(start, end, startTime, endTime){console.log(start);console.log(end);console.log(+end + +10);console.log(+start + +10);doAjaxRequestHandler(context+"/getPaginatedWalletHistory?startTime="+startTime+"&endTime="+endTime+"&offset="+end, "GET", function(response){$( "#wallet-history-paginated .end" ).text(+end + +10);$( "#wallet-history-paginated .start" ).text(+start + +10);var last = $( "#wallet-history-paginated .end" ).text();var temp = $( "#wallet-history-paginated .size" ).text();if (parseInt(last) >= parseInt(temp)){$("#wallet-history-paginated .next").prop('disabled', true);//$( "#good-inventory-paginated .end" ).text(temp);}$('#wallet-history-table').html(response);$("#wallet-history-paginated .previous").prop('disabled', false);});}function getWalletHistoryPreviousItems(start, end, pre, startTime, endTime){doAjaxRequestHandler(context+"/getPaginatedWalletHistory?startTime="+startTime+"&endTime="+endTime+"&offset="+pre, "GET", function(response){$( "#wallet-history-paginated .end" ).text(+end - +10);$( "#wallet-history-paginated .start" ).text(+start - +10);$('#wallet-history-table').html(response);$("#wallet-history-paginated .next").prop('disabled', false);if (parseInt(pre)==0){$("#wallet-history-paginated .previous").prop('disabled', true);}});}function loadWallet(domId, startTime, endTime){doAjaxRequestHandler(context+"/walletDetails?startTime="+startTime+"&endTime="+endTime, "GET", function(response){$('#' + domId).html(response);});}