Skip to content

Commit

Permalink
Select first comment initially
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Nov 8, 2007
1 parent a001b61 commit ccd4f77
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions themes/slashcode/htdocs/images/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var fetch_comments_pieces = {};
var update_comments = {};
var root_comments_hash = {};
var last_updated_comments = [];
var last_updated_comments_index = -1;
var last_updated_comments_index = 0;
var last_updated_comments_started = 0;
var current_cid = 0;
var more_comments_num;
var behaviors = {
Expand Down Expand Up @@ -1037,6 +1038,8 @@ function finishLoading() {
document.body.onkeydown = keyHandler;
}

setCurrentComment(last_updated_comments[i]);

if (more_comments_num)
updateMoreNum(more_comments_num);
updateTotals();
Expand Down Expand Up @@ -1718,7 +1721,10 @@ function keyHandler(e) {
ajaxFetchComments(0, 1, '', 1);
} else {
update = 1;
i = i + 1;
if (!i && !last_updated_comments_started && commentIsInWindow(last_updated_comments[i]))
i = i + 1;
else
last_updated_comments_started = 1; // only come here once
}
}

Expand Down

0 comments on commit ccd4f77

Please sign in to comment.