cdmScrollToArticle: set id as active if selected

This commit is contained in:
Andrew Dolgov 2018-11-30 20:24:10 +03:00
parent 08bee97858
commit 137bc3b3db
1 changed files with 4 additions and 0 deletions

View File

@ -455,6 +455,8 @@ function moveToPost(mode, noscroll, noexpand) {
} }
if (!getActiveArticleId()) { if (!getActiveArticleId()) {
console.log('hurr', rows[0]);
next_id = rows[0]; next_id = rows[0];
prev_id = rows[rows.length-1] prev_id = rows[rows.length-1]
} else { } else {
@ -983,6 +985,8 @@ function cdmScrollToArticleId(id, force) {
// expanded cdm has a 4px margin now // expanded cdm has a 4px margin now
ctr.scrollTop = parseInt(e.offsetTop) - 4; ctr.scrollTop = parseInt(e.offsetTop) - 4;
setActiveArticleId(id);
// article is selected manually, set it read // article is selected manually, set it read
toggleUnread(id, 0);1 toggleUnread(id, 0);1
} }