mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-02-01 00:51:13 -05:00
Improve align article on previous article
Always align view on previous article IF its top is not too far (magic number: 150px). See https://github.com/marienfressinaud/FreshRSS/issues/470
This commit is contained in:
@@ -251,9 +251,14 @@ function toggleContent(new_active, old_active) {
|
||||
}
|
||||
|
||||
if (sticky_post) {
|
||||
var new_pos = new_active.position().top - new_active.children('.flux_header').outerHeight(),
|
||||
var prev_article = new_active.prevAll('.flux'),
|
||||
new_pos = new_active.position().top,
|
||||
old_scroll = $(box_to_move).scrollTop();
|
||||
|
||||
if (prev_article.length > 0 && new_pos - prev_article.position().top <= 150) {
|
||||
new_pos = prev_article.position().top;
|
||||
}
|
||||
|
||||
if (hide_posts) {
|
||||
if (relative_move) {
|
||||
new_pos += old_scroll;
|
||||
|
||||
Reference in New Issue
Block a user