summaryrefslogtreecommitdiffstats
path: root/web/react/components/mention_list.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-07 17:44:32 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-07 17:44:32 -0400
commit809cc9f6f36a4b196885cd78572ff026c06cd0ae (patch)
tree9377a4cb4a1bcc396a09b283ac1ffce997977909 /web/react/components/mention_list.jsx
parent66e97a56b0814b7c2378e9c7b4603d1c6408d330 (diff)
downloadchat-809cc9f6f36a4b196885cd78572ff026c06cd0ae.tar.gz
chat-809cc9f6f36a4b196885cd78572ff026c06cd0ae.tar.bz2
chat-809cc9f6f36a4b196885cd78572ff026c06cd0ae.zip
Changed code to dismiss mention list to not trigger when you click on the list itself
Diffstat (limited to 'web/react/components/mention_list.jsx')
-rw-r--r--web/react/components/mention_list.jsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx
index b666fcfae..3fac41073 100644
--- a/web/react/components/mention_list.jsx
+++ b/web/react/components/mention_list.jsx
@@ -23,8 +23,9 @@ module.exports = React.createClass({
}
}
);
- $(document).click(function() {
- if($('#'+self.props.id).length && $('#'+self.props.id).get(0) !== $(':focus').get(0)) {
+ $(document).click(function(e) {
+ if (!($('#'+self.props.id).is(e.target) || $('#'+self.props.id).has(e.target).length ||
+ ('mentionlist' in self.refs && $(self.refs['mentionlist'].getDOMNode()).has(e.target).length))) {
self.setState({mentionText: "-1"})
}
});