summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-07-12 18:39:14 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-07-16 08:10:18 -0700
commitda228fc167494962dd222835510ff3a7db2e3a24 (patch)
tree87452a9d6ec2215cde6b075a6f864445a690f4a5 /web
parent6f93cbb490b41ec206b66018090f34e690a145a3 (diff)
downloadchat-da228fc167494962dd222835510ff3a7db2e3a24.tar.gz
chat-da228fc167494962dd222835510ff3a7db2e3a24.tar.bz2
chat-da228fc167494962dd222835510ff3a7db2e3a24.zip
Minor changes towards getting interior scrolling working with arrow keys
Diffstat (limited to 'web')
-rw-r--r--web/react/components/mention_list.jsx9
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;