diff options
author | Kacper Kula <kulak@kulak.at> | 2017-06-08 13:46:11 +0200 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-06-08 07:46:11 -0400 |
commit | 613a8736111456bf93ae09f6f8814dca1de187ed (patch) | |
tree | 964a5c8c8950554b1cf3c27a7832119960772b01 /webapp/components/rhs_comment.jsx | |
parent | f859b5f7afb391e0ae02dd69a6657574d14ece9a (diff) | |
download | chat-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_comment.jsx')
-rw-r--r-- | webapp/components/rhs_comment.jsx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx index 85c2fc1de..b7e82d903 100644 --- a/webapp/components/rhs_comment.jsx +++ b/webapp/components/rhs_comment.jsx @@ -46,6 +46,7 @@ export default class RhsComment 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; @@ -56,7 +57,8 @@ export default class RhsComment extends React.Component { width: '', height: '', showReactEmojiPicker: false, - reactPickerOffset: 15 + reactPickerOffset: 15, + dropdownOpened: false }; } @@ -135,6 +137,10 @@ export default class RhsComment extends React.Component { return true; } + if (this.state.dropdownOpened !== nextState.dropdownOpened) { + return true; + } + return false; } @@ -318,7 +324,10 @@ export default class RhsComment extends React.Component { } return ( - <RhsDropdown dropdownContents={dropdownContents}/> + <RhsDropdown + dropdownContents={dropdownContents} + handleDropdownOpened={this.handleDropdownOpened} + /> ); } @@ -386,9 +395,19 @@ export default class RhsComment 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 mattermostLogo = Constants.MATTERMOST_ICON_SVG; |