X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=root%2Fstatic%2Fjs%2Fsite.js;h=3c748fecedc6949eba3a0ce22d97042fcd60373b;hb=1c177f0e7b357a75e46eb07c52075e1165487f28;hp=7f9265b97da1b439788c8ed6815e6925f0081764;hpb=9992168adc7bb4e49d25d6b46517e6f0694dbaf1;p=catagits%2FGitalist.git diff --git a/root/static/js/site.js b/root/static/js/site.js index 7f9265b..3c748fe 100755 --- a/root/static/js/site.js +++ b/root/static/js/site.js @@ -1,12 +1,12 @@ function findPos(obj) { var curleft = curtop = 0; if (obj.offsetParent) { - do { - curleft += obj.offsetLeft; - curtop += obj.offsetTop; - } - while (obj = obj.offsetParent); - return [curleft,curtop]; + do { + curleft += obj.offsetLeft; + curtop += obj.offsetTop; + } + while (obj = obj.offsetParent); + return [curleft,curtop]; } } @@ -58,17 +58,21 @@ function compareDiffs(){ return false; } -function loadCommitInfo() { - jQuery('#commit-tree .message').each(function() { - var cell = jQuery(this); - var filename = cell.find('.js-data').text(); - jQuery.getJSON(uriFor('file_commit_info') + '/' + filename, {}, function(commitInfo) { - cell.empty(); - cell.html(''+commitInfo.comment+' '+commitInfo.age); - }); +function _loadCommitInfo(cells) { + var cell = jQuery(cells.shift()); + var filename = cell.find('.js-data').text(); + jQuery.getJSON(uriFor('file_commit_info') + '/' + filename, {}, function(commitInfo) { + cell.empty(); + cell.html(''+commitInfo.comment+' '+commitInfo.age); + if(cells.length > 0) + _loadCommitInfo(cells); }); } +function loadCommitInfo() { + _loadCommitInfo( jQuery('#commit-tree .message').get() ); +} + jQuery(function() { // Provide sub-nav dropdowns (I think). startList();