From c2c88519845b1f9fb13d448489c12b7ba38aa8b3 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Tue, 26 Jun 2012 11:20:05 -0700 Subject: [PATCH] Fixing animation preference in Feed view. --- media/js/newsblur/views/story_list_view.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/media/js/newsblur/views/story_list_view.js b/media/js/newsblur/views/story_list_view.js index fde9b6b6e..dff00ce16 100644 --- a/media/js/newsblur/views/story_list_view.js +++ b/media/js/newsblur/views/story_list_view.js @@ -68,17 +68,15 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({ scroll_to_selected_story: function(story, options) { options = options || {}; 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; - + + if (!NEWSBLUR.assets.preference('animations')) options.immediate = true; if (options.scroll_to_comments) { $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.scrollTo($story, { duration: options.immediate ? 0 : 340, @@ -87,8 +85,6 @@ NEWSBLUR.Views.StoryListView = Backbone.View.extend({ offset: options.scroll_offset || 0, queue: false, onAfter: function() { - if (options.immediate) return; - NEWSBLUR.reader.locks.scrolling = setTimeout(function() { NEWSBLUR.reader.flags.scrolling_by_selecting_story_title = false; }, 100);