mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Scrolling to comments in List view when clicking on Comments in story title.
This commit is contained in:
parent
487b79674c
commit
e5fb27eda2
2 changed files with 14 additions and 4 deletions
|
@ -755,10 +755,17 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
|
|||
},
|
||||
|
||||
scroll_to_comments: function() {
|
||||
NEWSBLUR.app.story_list.scroll_to_selected_story(this.model, {
|
||||
scroll_to_comments: true,
|
||||
scroll_offset: -50
|
||||
});
|
||||
if (_.contains(['list', 'grid'], NEWSBLUR.assets.view_setting(NEWSBLUR.reader.active_feed, 'layout'))) {
|
||||
NEWSBLUR.app.story_titles.scroll_to_selected_story(this.model, {
|
||||
scroll_to_comments: true,
|
||||
scroll_offset: -50
|
||||
});
|
||||
} else {
|
||||
NEWSBLUR.app.story_list.scroll_to_selected_story(this.model, {
|
||||
scroll_to_comments: true,
|
||||
scroll_offset: -50
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -280,6 +280,9 @@ NEWSBLUR.Views.StoryTitlesView = Backbone.View.extend({
|
|||
_.contains(['list', 'grid'], NEWSBLUR.assets.view_setting(NEWSBLUR.reader.active_feed, 'layout'))) {
|
||||
var container_offset = NEWSBLUR.reader.$s.$story_titles.position().top;
|
||||
var scroll = story_title_view.$el.find('.NB-story-title').position().top;
|
||||
if (options.scroll_to_comments) {
|
||||
scroll = story_title_view.$el.find('.NB-feed-story-comments').position().top;
|
||||
}
|
||||
var container = NEWSBLUR.reader.$s.$story_titles.scrollTop();
|
||||
var height = NEWSBLUR.reader.$s.$story_titles.outerHeight();
|
||||
var position = scroll+container-height/5;
|
||||
|
|
Loading…
Add table
Reference in a new issue