diff options
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/mention_list.jsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx index e6b2f5e04..92a843bc5 100644 --- a/web/react/components/mention_list.jsx +++ b/web/react/components/mention_list.jsx @@ -55,7 +55,8 @@ module.exports = React.createClass({ } self.refs['mention' + self.state.selectedMention].select(); - //self.checkIfInView('#'+self.props.id); + self.checkIfInView($('#'+self.props.id)); + self.checkIfInView($('#'+self.refs['mention' + self.state.selectedMention].props.id)); } } ); @@ -118,10 +119,10 @@ module.exports = React.createClass({ return (!this.refs.mention0); }, checkIfInView: function(element) { - var offset = element.offset().top - $(window).scrollTop(); + var offset = element.offset().top - $(window).scrollTop(); //$(this.props.id) ?? if(offset > window.innerHeight){ // Not in view so scroll to it - $('body').animate({scrollTop: offset}, 1000); + $('body').animate({scrollTop: offset}, 1000); //$(this.props.id) ?? return false; } return true; @@ -136,7 +137,7 @@ module.exports = React.createClass({ return false; }, getInitialState: function() { - return { excludeUsers: [], mentionText: "-1", selectedMention: 0, selectedUsername: "" }; + return { excludeUsers: [], mentionText: "-1", selectedMention: 0 }; }, render: function() { var mentionText = this.state.mentionText; |