From 6c78ec343927275f3460fff7d4afc34889b2004b Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Fri, 14 Aug 2015 09:58:12 -0700
Subject: Changed timeout code to event based

---
 web/react/components/post_list.jsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'web/react/components/post_list.jsx')

diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 1850d6256..96bcf28e1 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -65,10 +65,13 @@ module.exports = React.createClass({
 
         // Timeout exists for the DOM to fully render before making changes
         var self = this
-        setTimeout(function initialScroll() {
+        function initialScroll() {
             self.holdPosition = false;
             self.scrollWindow();
-        }, 1);
+            $(document).off('DOMContentLoaded', initialScroll)
+        }
+
+        $(document).on('DOMContentLoaded', initialScroll);
 
         // Handle browser resizing
         $(window).resize(this.onResize);
-- 
cgit v1.2.3-1-g7c22

