diff options
author | nickago <ngonella@calpoly.edu> | 2015-07-01 09:53:32 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-07-01 09:53:32 -0700 |
commit | 26560b5fc61dd8272f689d692638cb5e50b9e366 (patch) | |
tree | 66acd682aa389b2848850f0ba0e6a9930909e32b /web | |
parent | 5e204030ffe91aaab090a26547185017edf1d2e1 (diff) | |
download | chat-26560b5fc61dd8272f689d692638cb5e50b9e366.tar.gz chat-26560b5fc61dd8272f689d692638cb5e50b9e366.tar.bz2 chat-26560b5fc61dd8272f689d692638cb5e50b9e366.zip |
Inital attempt at active element checking
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/mention_list.jsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx index eb21e0efe..37fd3e2dc 100644 --- a/web/react/components/mention_list.jsx +++ b/web/react/components/mention_list.jsx @@ -23,6 +23,12 @@ module.exports = React.createClass({ } } ); + $(document).click(function() { + if ($(document.activeElement).get(0) != $('#'+this.props.id).get(0)) { + this.setState({ mentionText: '-1'}) + console.log(this.state) + } + }); }, componentWillUnmount: function() { PostStore.removeMentionDataChangeListener(this._onChange); @@ -131,7 +137,7 @@ module.exports = React.createClass({ return ( <div className="mentions--top" style={{height: height, width: width, bottom: bottom, left: left}}> - <div ref="mentionlist" className="mentions-box" style={{maxHeight: max_height, height: height, width: width}}> + <div ref="mentionlist" id="mentionlist" className="mentions-box" style={{maxHeight: max_height, height: height, width: width}}> { mentions } </div> </div> |