From 3f316b29f01ee5f2a8087a408d6af3b3e8e70a8d Mon Sep 17 00:00:00 2001
From: Robin Ward <robin.ward@gmail.com>
Date: Fri, 8 Aug 2014 17:38:10 -0400
Subject: [PATCH] FIX: Don't trigger `scrolled` while the router is
 transitioning.

---
 app/assets/javascripts/discourse/mixins/scrolling.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/assets/javascripts/discourse/mixins/scrolling.js b/app/assets/javascripts/discourse/mixins/scrolling.js
index b86631de22d..6178e46a33d 100644
--- a/app/assets/javascripts/discourse/mixins/scrolling.js
+++ b/app/assets/javascripts/discourse/mixins/scrolling.js
@@ -19,8 +19,12 @@ Discourse.Scrolling = Em.Mixin.create({
   bindScrolling: function(opts) {
     opts = opts || {debounce: 100};
 
+    // So we can not call the scrolled event while transitioning
+    var router = Discourse.__container__.lookup('router:main').router;
+
     var self = this,
         onScrollMethod = function() {
+          if (router.activeTransition) { return; }
           return Em.run.scheduleOnce('afterRender', self, 'scrolled');
         };