tweak moveToPost behaviour in unexpanded mode
This commit is contained in:
parent
f0540b598a
commit
79074013cb
1 changed files with 19 additions and 9 deletions
|
@ -559,16 +559,23 @@ function moveToPost(mode, noscroll) {
|
||||||
var prev_article = $("RROW-" + prev_id);
|
var prev_article = $("RROW-" + prev_id);
|
||||||
var ctr = $("headlines-frame");
|
var ctr = $("headlines-frame");
|
||||||
|
|
||||||
if (!noscroll && article && article.offsetTop < ctr.scrollTop) {
|
if (!getInitParam("cdm_expanded")) {
|
||||||
scrollArticle(-ctr.offsetHeight/3);
|
|
||||||
} else if (!noscroll && prev_article &&
|
|
||||||
prev_article.offsetTop < ctr.scrollTop) {
|
|
||||||
cdmExpandArticle(prev_id);
|
cdmExpandArticle(prev_id);
|
||||||
scrollArticle(-ctr.offsetHeight/3);
|
cdmScrollToArticleId(prev_id, true);
|
||||||
} else if (prev_id) {
|
} else {
|
||||||
cdmExpandArticle(prev_id);
|
|
||||||
cdmScrollToArticleId(prev_id, noscroll);
|
if (!noscroll && article && article.offsetTop < ctr.scrollTop) {
|
||||||
|
scrollArticle(-ctr.offsetHeight/3);
|
||||||
|
} else if (!noscroll && prev_article &&
|
||||||
|
prev_article.offsetTop < ctr.scrollTop) {
|
||||||
|
cdmExpandArticle(prev_id);
|
||||||
|
scrollArticle(-ctr.offsetHeight/3);
|
||||||
|
} else if (prev_id) {
|
||||||
|
cdmExpandArticle(prev_id);
|
||||||
|
cdmScrollToArticleId(prev_id, noscroll);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (prev_id) {
|
} else if (prev_id) {
|
||||||
correctHeadlinesOffset(prev_id);
|
correctHeadlinesOffset(prev_id);
|
||||||
view(prev_id, getActiveFeedId());
|
view(prev_id, getActiveFeedId());
|
||||||
|
@ -1365,7 +1372,10 @@ function cdmExpandArticle(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
setActiveArticleId(id);
|
setActiveArticleId(id);
|
||||||
cdmScrollToArticleId(id, true);
|
|
||||||
|
if (!getInitParam("cdm_expanded")) {
|
||||||
|
cdmScrollToArticleId(id, true);
|
||||||
|
}
|
||||||
|
|
||||||
elem = $("CICD-" + id);
|
elem = $("CICD-" + id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue