mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Don't scroll to story if it isn't visible.
This commit is contained in:
parent
b576e274a2
commit
7b3a88b0a4
1 changed files with 6 additions and 1 deletions
|
@ -186,7 +186,7 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
scroll_to_selected_story: function(story, options) {
|
||||
options = options || {};
|
||||
if (!story) story = NEWSBLUR.reader.active_story;
|
||||
if (!story || !story.story_view || !story.story_view.$el.length) return;
|
||||
if (!story || !story.story_view) return;
|
||||
var $story = story.story_view.$el;
|
||||
|
||||
if (NEWSBLUR.assets.preference('feed_view_single_story')) {
|
||||
|
@ -201,6 +201,11 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
if (!options.scroll_to_top && !$story.closest(NEWSBLUR.reader.$s.$feed_scroll).length) {
|
||||
console.log(['Story not visible, not scrolling', $story]);
|
||||
return;
|
||||
}
|
||||
|
||||
clearTimeout(NEWSBLUR.reader.locks.scrolling);
|
||||
NEWSBLUR.reader.flags.scrolling_by_selecting_story_title = true;
|
||||
var scroll_to = options.scroll_to_top ? 0 : $story;
|
||||
|
|
Loading…
Add table
Reference in a new issue