Skip to content

Commit

Permalink
Remove limitation on toggleContent (FreshRSS#1647)
Browse files Browse the repository at this point in the history
Before, articles were repositioned only when the new and the old article were different. When they were the same, it was just closed.
It was frustrating with long articles, especially during reading.

Now, when an article is collapsed, it is repositionned no matter the collapsing method.

This should fix FreshRSS#1177
  • Loading branch information
aledeg authored and Alkarex committed Sep 30, 2017
1 parent b10a911 commit 7907e67
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions p/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,9 @@ function toggleContent(new_active, old_active) {
new_pos += old_scroll;
}

if (old_active[0] !== new_active[0]) {
new_active.children(".flux_content").first().each(function () {
box_to_move.scrollTop(new_pos).scrollTop();
});
}
new_active.children(".flux_content").first().each(function () {
box_to_move.scrollTop(new_pos).scrollTop();
});
} else {
if (relative_move) {
new_pos += old_scroll;
Expand Down Expand Up @@ -386,13 +384,8 @@ function last_category() {
}

function collapse_entry() {
isCollapsed = !isCollapsed;

var flux_current = $(".flux.current");
flux_current.toggleClass("active");
if (isCollapsed && context.auto_mark_article) {
mark_read(flux_current, true);
}
toggleContent(flux_current, flux_current);
}

function user_filter(key) {
Expand Down

0 comments on commit 7907e67

Please sign in to comment.