);
@@ -562,6 +563,10 @@ export default class PostList extends React.Component {
this.checkAndUpdateScrolling();
}
+ getPostList = () => {
+ return this.refs.postlist;
+ }
+
render() {
// Create intro message or top loadmore link
let moreMessagesTop;
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx
index b7e82d9038..20734c4f4b 100644
--- a/webapp/components/rhs_comment.jsx
+++ b/webapp/components/rhs_comment.jsx
@@ -20,12 +20,10 @@ import * as PostUtils from 'utils/post_utils.jsx';
import Constants from 'utils/constants.jsx';
import DelayedAction from 'utils/delayed_action.jsx';
-import {Overlay} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl';
-import EmojiPicker from 'components/emoji_picker/emoji_picker.jsx';
-import ReactDOM from 'react-dom';
+import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay.jsx';
import loadingGif from 'images/load.gif';
@@ -45,7 +43,6 @@ export default class RhsComment extends React.Component {
this.pinPost = this.pinPost.bind(this);
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;
@@ -56,8 +53,7 @@ export default class RhsComment extends React.Component {
currentTeamDisplayName: TeamStore.getCurrent().name,
width: '',
height: '',
- showReactEmojiPicker: false,
- reactPickerOffset: 15,
+ showEmojiPicker: false,
dropdownOpened: false
};
}
@@ -129,7 +125,7 @@ export default class RhsComment extends React.Component {
return true;
}
- if (this.state.showReactEmojiPicker !== nextState.showReactEmojiPicker) {
+ if (this.state.showEmojiPicker !== nextState.showEmojiPicker) {
return true;
}
@@ -356,22 +352,17 @@ export default class RhsComment extends React.Component {
);
}
- emojiPickerClick() {
- // set default offset
- let reactOffset = 15;
- const reactSelectorHeight = 360;
- const reactionIconY = ReactDOM.findDOMNode(this).getBoundingClientRect().top;
- const rhsMinHeight = 700;
+ toggleEmojiPicker = () => {
+ const showEmojiPicker = !this.state.showEmojiPicker;
- const spaceAvail = rhsMinHeight - reactionIconY;
- if (spaceAvail < reactSelectorHeight) {
- reactOffset = (spaceAvail - reactSelectorHeight);
- }
- this.setState({showReactEmojiPicker: !this.state.showReactEmojiPicker, reactPickerOffset: reactOffset});
+ this.setState({
+ showEmojiPicker,
+ dropdownOpened: showEmojiPicker
+ });
}
reactEmojiClick(emoji) {
- this.setState({showReactEmojiPicker: false});
+ this.setState({showEmojiPicker: false});
const emojiName = emoji.name || emoji.aliases[0];
addReaction(this.props.post.channel_id, this.props.post.id, emojiName);
}
@@ -554,39 +545,26 @@ export default class RhsComment extends React.Component {
}
let react;
- let reactOverlay;
-
if (!isEphemeral && !isPending && !isSystemMessage && Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMOJI_PICKER_PREVIEW)) {
react = (
+ this.refs.dotMenu}
+ container={this.props.getPostList}
+ onEmojiClick={this.reactEmojiClick}
+ />
);
- reactOverlay = (
-
this.setState({showReactEmojiPicker: false})}
- target={() => ReactDOM.findDOMNode(this.refs['rhs_reacticon_' + post.id])}
- animation={false}
- >
-
-
- );
}
let options;
@@ -598,8 +576,10 @@ export default class RhsComment extends React.Component {
);
} else if (!isSystemMessage) {
options = (
-
- {reactOverlay}
+
{this.createDropdown(isSystemMessage)}
{react}
@@ -674,5 +654,6 @@ RhsComment.propTypes = {
useMilitaryTime: PropTypes.bool.isRequired,
isFlagged: PropTypes.bool,
status: PropTypes.string,
- isBusy: PropTypes.bool
+ isBusy: PropTypes.bool,
+ getPostList: PropTypes.func.isRequired
};
diff --git a/webapp/components/rhs_root_post.jsx b/webapp/components/rhs_root_post.jsx
index c00022e9e6..e77fb79924 100644
--- a/webapp/components/rhs_root_post.jsx
+++ b/webapp/components/rhs_root_post.jsx
@@ -20,12 +20,10 @@ import {flagPost, unflagPost, pinPost, unpinPost, addReaction} from 'actions/pos
import * as Utils from 'utils/utils.jsx';
import * as PostUtils from 'utils/post_utils.jsx';
-import EmojiPicker from 'components/emoji_picker/emoji_picker.jsx';
-import ReactDOM from 'react-dom';
+import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay.jsx';
import Constants from 'utils/constants.jsx';
import DelayedAction from 'utils/delayed_action.jsx';
-import {Overlay} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl';
@@ -44,7 +42,6 @@ export default class RhsRootPost extends React.Component {
this.pinPost = this.pinPost.bind(this);
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;
@@ -55,7 +52,7 @@ export default class RhsRootPost extends React.Component {
currentTeamDisplayName: TeamStore.getCurrent().name,
width: '',
height: '',
- showRHSEmojiPicker: false,
+ showEmojiPicker: false,
testStateObj: true,
dropdownOpened: false
};
@@ -119,7 +116,7 @@ export default class RhsRootPost extends React.Component {
return true;
}
- if (this.state.showRHSEmojiPicker !== nextState.showRHSEmojiPicker) {
+ if (this.state.showEmojiPicker !== nextState.showEmojiPicker) {
return true;
}
@@ -175,12 +172,17 @@ export default class RhsRootPost extends React.Component {
unpinPost(this.props.post.channel_id, this.props.post.id);
}
- emojiPickerClick() {
- this.setState({showRHSEmojiPicker: !this.state.showRHSEmojiPicker});
+ toggleEmojiPicker = () => {
+ const showEmojiPicker = !this.state.showEmojiPicker;
+
+ this.setState({
+ showEmojiPicker,
+ dropdownOpened: showEmojiPicker
+ });
}
reactEmojiClick(emoji) {
- this.setState({showRHSEmojiPicker: false});
+ this.setState({showEmojiPicker: false});
const emojiName = emoji.name || emoji.aliases[0];
addReaction(this.props.post.channel_id, this.props.post.id, emojiName);
}
@@ -250,38 +252,26 @@ export default class RhsRootPost extends React.Component {
}
let react;
- let reactOverlay;
-
if (!isEphemeral && !isPending && !isSystemMessage && Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMOJI_PICKER_PREVIEW)) {
react = (
+ this.refs.dotMenu}
+ container={this.props.getPostList}
+ onEmojiClick={this.reactEmojiClick}
+ />
);
- reactOverlay = (
-
this.setState({showRHSEmojiPicker: false})}
- target={() => ReactDOM.findDOMNode(this.refs.rhs_root_reacticon)}
- animation={false}
- >
-
-
- );
}
var dropdownContents = [];
@@ -590,8 +580,10 @@ export default class RhsRootPost extends React.Component {
isFlagged={this.props.isFlagged}
/>
-
- {reactOverlay}
+
{rootOptions}
{react}
@@ -628,5 +620,6 @@ RhsRootPost.propTypes = {
isFlagged: PropTypes.bool,
status: PropTypes.string,
previewCollapsed: PropTypes.string,
- isBusy: PropTypes.bool
+ isBusy: PropTypes.bool,
+ getPostList: PropTypes.func.isRequired
};
diff --git a/webapp/components/rhs_thread.jsx b/webapp/components/rhs_thread.jsx
index bcb8a715f7..a532119b80 100644
--- a/webapp/components/rhs_thread.jsx
+++ b/webapp/components/rhs_thread.jsx
@@ -338,6 +338,10 @@ export default class RhsThread extends React.Component {
});
}
+ getPostListContainer = () => {
+ return this.refs.postListContainer;
+ }
+
render() {
if (this.state.postsArray == null || this.state.selected == null) {
return (
@@ -414,6 +418,7 @@ export default class RhsThread extends React.Component {
isFlagged={isFlagged}
status={status}
isBusy={this.state.isBusy}
+ getPostList={this.getPostListContainer}
/>
);
@@ -446,7 +451,7 @@ export default class RhsThread extends React.Component {
onScroll={this.handleScroll}
>
li.active > a, .app__body .emoji-picker-bottom, .app__body .emoji-picker__search', 'background:' + theme.centerChannelBg);
+ changeCss('.app__body .nav-tabs, .app__body .nav-tabs > li.active > a', 'background:' + theme.centerChannelBg);
}
if (theme.centerChannelColor) {
@@ -678,12 +675,8 @@ export function applyTheme(theme) {
changeCss('.app__body .post-reaction:not(.post-reaction--current-user)', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.25));
changeCss('.app__body .post-reaction:not(.post-reaction--current-user)', 'color:' + changeOpacity(theme.centerChannelColor, 0.7));
changeCss('.app__body .emoji-picker', 'color:' + theme.centerChannelColor);
- changeCss('.app__body .emoji-picker-react', 'color:' + theme.centerChannelColor);
- changeCss('.app__body .emoji-picker-bottom', 'color:' + theme.centerChannelColor);
- changeCss('.app__body .emoji-picker, .app__body .emoji-picker-react-rhs-comment, .app__body .emoji-picker-react, .app__body .emoji-picker__search-container .emoji-picker__search', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2));
- changeCss('.app__body .emoji-picker-bottom, .app__body .emoji-picker__search-container .emoji-picker__search', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2));
+ changeCss('.app__body .emoji-picker, .app__body .emoji-picker__search-container .emoji-picker__search', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2));
changeCss('.app__body .emoji-picker, .app__body .emoji-picker__items .emoji-picker__search-container .emoji-picker__search', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2));
- changeCss('.app__body .emoji-picker-bottom, .app__body .emoji-picker__items .emoji-picker__search-container .emoji-picker__search', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2));
changeCss('.app__body .emoji-picker__items', 'background-color:' + changeOpacity(theme.centerChannelColor, 0.05));
changeCss('.app__body .emoji-picker__categories', 'border-bottom-color:' + changeOpacity(theme.centerChannelColor, 0.2));
changeCss('.emoji-picker__category .fa:hover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8));