From 99f243b44443babe3fd332538d2b102218834462 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Wed, 14 Oct 2015 17:04:13 +0500 Subject: Multiple UI Improvements --- web/react/components/create_post.jsx | 5 ++++- web/react/components/error_bar.jsx | 21 --------------------- web/react/components/post_info.jsx | 1 + web/react/components/sidebar.jsx | 26 +++++++++++++++++++++++++- web/react/components/user_profile.jsx | 2 +- 5 files changed, 31 insertions(+), 24 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index ed265ab02..f35079383 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 b100fd337..6311d9460 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 7addd825f..a95095ff6 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 {