summaryrefslogtreecommitdiffstats
path: root/webapp/components/rhs_root_post.jsx
diff options
context:
space:
mode:
authorKacper Kula <kulak@kulak.at>2017-06-08 13:46:11 +0200
committerJoram Wilander <jwawilander@gmail.com>2017-06-08 07:46:11 -0400
commit613a8736111456bf93ae09f6f8814dca1de187ed (patch)
tree964a5c8c8950554b1cf3c27a7832119960772b01 /webapp/components/rhs_root_post.jsx
parentf859b5f7afb391e0ae02dd69a6657574d14ece9a (diff)
downloadchat-613a8736111456bf93ae09f6f8814dca1de187ed.tar.gz
chat-613a8736111456bf93ae09f6f8814dca1de187ed.tar.bz2
chat-613a8736111456bf93ae09f6f8814dca1de187ed.zip
[PLT-6394] [...] menu no longer hides when not hovered. (#6353)
* [PLT-6394] [...] menu no longer hides when not hovered. * Fixed dropdown visibility to use same method as main window.
Diffstat (limited to 'webapp/components/rhs_root_post.jsx')
-rw-r--r--webapp/components/rhs_root_post.jsx23
1 files changed, 21 insertions, 2 deletions
diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx
index f48b4e86a..c00022e9e 100644
--- a/webapp/components/rhs_root_post.jsx
+++ b/webapp/components/rhs_root_post.jsx
@@ -45,6 +45,7 @@ export default class RhsRootPost extends React.Component {
this.unpinPost = this.unpinPost.bind(this);
this.reactEmojiClick = this.reactEmojiClick.bind(this);
this.emojiPickerClick = this.emojiPickerClick.bind(this);
+ this.handleDropdownOpened = this.handleDropdownOpened.bind(this);
this.canEdit = false;
this.canDelete = false;
@@ -55,7 +56,8 @@ export default class RhsRootPost extends React.Component {
width: '',
height: '',
showRHSEmojiPicker: false,
- testStateObj: true
+ testStateObj: true,
+ dropdownOpened: false
};
}
@@ -121,6 +123,10 @@ export default class RhsRootPost extends React.Component {
return true;
}
+ if (this.state.dropdownOpened !== nextState.dropdownOpened) {
+ return true;
+ }
+
return false;
}
@@ -197,9 +203,19 @@ export default class RhsRootPost extends React.Component {
className += ' post--pinned';
}
+ if (this.state.dropdownOpened) {
+ className += ' post--hovered';
+ }
+
return className;
}
+ handleDropdownOpened(isOpened) {
+ this.setState({
+ dropdownOpened: isOpened
+ });
+ }
+
render() {
const post = this.props.post;
const user = this.props.user;
@@ -413,7 +429,10 @@ export default class RhsRootPost extends React.Component {
var rootOptions = '';
if (dropdownContents.length > 0) {
rootOptions = (
- <RhsDropdown dropdownContents={dropdownContents}/>
+ <RhsDropdown
+ dropdownContents={dropdownContents}
+ handleDropdownOpened={this.handleDropdownOpened}
+ />
);
}