From d9afa47ef803f3069427192acf839d21bb5a8d93 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 14 Jul 2015 08:07:01 -0400 Subject: Revert "MM-831 Time change ping riding on the status interupt for timestamp update" --- web/react/components/post_list.jsx | 16 +--------------- web/react/components/post_right.jsx | 18 ++---------------- 2 files changed, 3 insertions(+), 31 deletions(-) (limited to 'web') diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index e73bc10cc..9349d0240 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -35,8 +35,6 @@ module.exports = React.createClass({ oldScrollHeight: 0, oldZoom: 0, scrolledToNew: false, - preForcePosision: 0, - wasForced: false, componentDidMount: function() { var user = UserStore.getCurrentUser(); if (user.props && user.props.theme) { @@ -52,7 +50,6 @@ module.exports = React.createClass({ PostStore.addChangeListener(this._onChange); ChannelStore.addChangeListener(this._onChange); - UserStore.addStatusesChangeListener(this._onTimeChange); SocketStore.addChangeListener(this._onSocketChange); $(".post-list-holder-by-time").perfectScrollbar(); @@ -82,11 +79,6 @@ module.exports = React.createClass({ }); $(post_holder).scroll(function(e){ - if (self.wasForced) { - $(post_holder).scrollTop(self.preForcePosision); - $(post_holder).perfectScrollbar('update'); - self.wasForced = false; - } if (!self.preventScrollTrigger) { self.scrollPosition = $(post_holder).scrollTop() + $(post_holder).innerHeight(); } @@ -137,7 +129,6 @@ module.exports = React.createClass({ componentWillUnmount: function() { PostStore.removeChangeListener(this._onChange); ChannelStore.removeChangeListener(this._onChange); - UserStore.removeStatusesChangeListener(this._onTimeChange); SocketStore.removeChangeListener(this._onSocketChange); $('body').off('click.userpopover'); }, @@ -170,7 +161,7 @@ module.exports = React.createClass({ this.scrolledToNew = false; } this.setState(newState); - } + } }, _onSocketChange: function(msg) { if (msg.action == "posted") { @@ -234,11 +225,6 @@ module.exports = React.createClass({ AsyncClient.getProfiles(); } }, - _onTimeChange: function() { - this.wasForced = true; - this.preForcePosision = $(".post-list-holder-by-time").scrollTop(); - this.forceUpdate(); - }, getMorePosts: function(e) { e.preventDefault(); diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index 27195dfba..408fbf83a 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -281,11 +281,9 @@ function getStateFromStores() { } module.exports = React.createClass({ - wasForced: false, componentDidMount: function() { PostStore.addSelectedPostChangeListener(this._onChange); PostStore.addChangeListener(this._onChangeAll); - UserStore.addStatusesChangeListener(this._onTimeChange); this.resize(); var self = this; $(window).resize(function(){ @@ -293,15 +291,11 @@ module.exports = React.createClass({ }); }, componentDidUpdate: function() { - if(!this.wasForced){ - this.resize(); - this.wasForced = false; - } + this.resize(); }, componentWillUnmount: function() { PostStore.removeSelectedPostChangeListener(this._onChange); PostStore.removeChangeListener(this._onChangeAll); - UserStore.removeStatusesChangeListener(this._onTimeChange); }, _onChange: function() { if (this.isMounted()) { @@ -341,14 +335,6 @@ module.exports = React.createClass({ this.setState(getStateFromStores()); } }, - _onTimeChange: function() { - this.wasForced = true; - for (var key in this.refs) { - if(this.refs[key].forceUpdate != undefined) { - this.refs[key].forceUpdate(); - } - } - }, getInitialState: function() { return getStateFromStores(); }, @@ -408,7 +394,7 @@ module.exports = React.createClass({
{ posts_array.map(function(cpost) { - return + return })}
-- cgit v1.2.3-1-g7c22