diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index ed265ab02f..f350793833 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -192,9 +192,12 @@ export default class CreatePost extends React.Component { PostStore.storeCurrentDraft(draft); } resizePostHolder() { - const height = $(window).height() - $(React.findDOMNode(this.refs.topDiv)).height() - $('#error_bar').outerHeight() - 50; + const height = $(window).height() - $(React.findDOMNode(this.refs.topDiv)).height() - 50; $('.post-list-holder-by-time').css('height', `${height}px`); $(window).trigger('resize'); + if ($(window).width() > 960) { + $('#post_textbox').focus(); + } } handleUploadStart(clientIds, channelId) { const draft = PostStore.getDraft(channelId); diff --git a/web/react/components/error_bar.jsx b/web/react/components/error_bar.jsx index b100fd3377..6311d9460c 100644 --- a/web/react/components/error_bar.jsx +++ b/web/react/components/error_bar.jsx @@ -9,7 +9,6 @@ export default class ErrorBar extends React.Component { this.onErrorChange = this.onErrorChange.bind(this); this.handleClose = this.handleClose.bind(this); - this.resize = this.resize.bind(this); this.prevTimer = null; this.state = ErrorStore.getLastError(); @@ -46,34 +45,14 @@ export default class ErrorBar extends React.Component { return false; } - resize() { - if (this.isValidError(this.state)) { - var height = $(React.findDOMNode(this)).outerHeight(); - height = height < 30 ? 30 : height; - $('body').css('padding-top', height + 'px'); - } else { - $('body').css('padding-top', '0'); - } - } - componentDidMount() { ErrorStore.addChangeListener(this.onErrorChange); - - $(window).resize(() => { - this.resize(); - }); - - this.resize(); } componentWillUnmount() { ErrorStore.removeChangeListener(this.onErrorChange); } - componentDidUpdate() { - this.resize(); - } - onErrorChange() { var newState = ErrorStore.getLastError(); diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index 7addd825fa..a95095ff6a 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -150,6 +150,7 @@ export default class PostInfo extends React.Component {