summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_list.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-08-14 09:58:12 -0700
committernickago <ngonella@calpoly.edu>2015-08-14 09:58:12 -0700
commit6c78ec343927275f3460fff7d4afc34889b2004b (patch)
tree2afe718874fe2c2cd4915681b96a9e5215be5564 /web/react/components/post_list.jsx
parentd53827cce396035695c15a282c602e3d3a184369 (diff)
downloadchat-6c78ec343927275f3460fff7d4afc34889b2004b.tar.gz
chat-6c78ec343927275f3460fff7d4afc34889b2004b.tar.bz2
chat-6c78ec343927275f3460fff7d4afc34889b2004b.zip
Changed timeout code to event based
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r--web/react/components/post_list.jsx7
1 files changed, 5 insertions, 2 deletions
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);