mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Fixing animation preference in Feed view.
This commit is contained in:
parent
9b2ed2944d
commit
c2c8851984
1 changed files with 4 additions and 8 deletions
|
@ -68,17 +68,15 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
||||||
scroll_to_selected_story: function(story, options) {
|
scroll_to_selected_story: function(story, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if (!story || !story.story_view) return;
|
if (!story || !story.story_view) return;
|
||||||
|
|
||||||
if (!options.immediate) {
|
|
||||||
clearTimeout(NEWSBLUR.reader.locks.scrolling);
|
|
||||||
NEWSBLUR.reader.flags.scrolling_by_selecting_story_title = true;
|
|
||||||
}
|
|
||||||
var $story = story.story_view.$el;
|
var $story = story.story_view.$el;
|
||||||
|
|
||||||
|
if (!NEWSBLUR.assets.preference('animations')) options.immediate = true;
|
||||||
if (options.scroll_to_comments) {
|
if (options.scroll_to_comments) {
|
||||||
$story = $('.NB-feed-story-comments', $story);
|
$story = $('.NB-feed-story-comments', $story);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearTimeout(NEWSBLUR.reader.locks.scrolling);
|
||||||
|
NEWSBLUR.reader.flags.scrolling_by_selecting_story_title = true;
|
||||||
this.$el.scrollable().stop();
|
this.$el.scrollable().stop();
|
||||||
this.$el.scrollTo($story, {
|
this.$el.scrollTo($story, {
|
||||||
duration: options.immediate ? 0 : 340,
|
duration: options.immediate ? 0 : 340,
|
||||||
|
@ -87,8 +85,6 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({
|
||||||
offset: options.scroll_offset || 0,
|
offset: options.scroll_offset || 0,
|
||||||
queue: false,
|
queue: false,
|
||||||
onAfter: function() {
|
onAfter: function() {
|
||||||
if (options.immediate) return;
|
|
||||||
|
|
||||||
NEWSBLUR.reader.locks.scrolling = setTimeout(function() {
|
NEWSBLUR.reader.locks.scrolling = setTimeout(function() {
|
||||||
NEWSBLUR.reader.flags.scrolling_by_selecting_story_title = false;
|
NEWSBLUR.reader.flags.scrolling_by_selecting_story_title = false;
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
Loading…
Add table
Reference in a new issue