[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.
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
f859b5f7af
Коммит
613a873611
@@ -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;
|
||||
|
||||
Ссылка в новой задаче
Block a user