diff options
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/login.jsx | 6 | ||||
-rw-r--r-- | web/react/components/more_direct_channels.jsx | 4 | ||||
-rw-r--r-- | web/react/components/popover_list_members.jsx | 22 | ||||
-rw-r--r-- | web/react/components/post_attachment.jsx | 5 | ||||
-rw-r--r-- | web/react/components/search_autocomplete.jsx | 12 | ||||
-rw-r--r-- | web/react/components/settings_sidebar.jsx | 4 |
6 files changed, 31 insertions, 22 deletions
diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index f7f5bd23d..423ba9067 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -125,7 +125,7 @@ export default class Login extends React.Component { let emailSignup; if (global.window.mm_config.EnableSignUpWithEmail === 'true') { emailSignup = ( - <div> + <div className='signup__email-container'> <div className={'form-group' + errorClass}> <input autoFocus={focusEmail} @@ -206,7 +206,7 @@ export default class Login extends React.Component { href='/' className='signup-team-login' > - {'Sign up now'} + {'Create one now'} </a> </span> </div> @@ -215,11 +215,11 @@ export default class Login extends React.Component { return ( <div className='signup-team__container'> - {verifiedBox} <h5 className='margin--less'>{'Sign in to:'}</h5> <h2 className='signup-team__name'>{teamDisplayName}</h2> <h2 className='signup-team__subdomain'>{'on '}{global.window.mm_config.SiteName}</h2> <form onSubmit={this.handleSubmit}> + {verifiedBox} <div className={'form-group' + errorClass}> {serverError} </div> diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx index 40deb37f2..d1265f67e 100644 --- a/web/react/components/more_direct_channels.jsx +++ b/web/react/components/more_direct_channels.jsx @@ -50,6 +50,10 @@ export default class MoreDirectChannels extends React.Component { handleFilterChange() { const filter = ReactDOM.findDOMNode(this.refs.filter).value; + if ($(window).width() > 768) { + $(ReactDOM.findDOMNode(this.refs.userList)).scrollTop(0); + } + if (filter !== this.state.filter) { this.setState({filter}); } diff --git a/web/react/components/popover_list_members.jsx b/web/react/components/popover_list_members.jsx index bd6b6d3bd..102bddcf5 100644 --- a/web/react/components/popover_list_members.jsx +++ b/web/react/components/popover_list_members.jsx @@ -69,7 +69,6 @@ export default class PopoverListMembers extends React.Component { render() { let popoverHtml = []; - let countText = '-'; const members = this.props.members; const teamMembers = UserStore.getProfilesUsernameMap(); const currentUserId = UserStore.getCurrentId(); @@ -148,13 +147,20 @@ export default class PopoverListMembers extends React.Component { ); } }); + } - const count = this.props.memberCount; - if (count > 20) { - countText = '20+'; - } else if (count > 0) { - countText = count.toString(); - } + let count = this.props.memberCount; + let countText = '-'; + + // fall back to checking the length of the member list if the count isn't set + if (!count && members) { + count = members.length; + } + + if (count > 20) { + countText = '20+'; + } else if (count > 0) { + countText = count.toString(); } return ( @@ -194,6 +200,6 @@ export default class PopoverListMembers extends React.Component { PopoverListMembers.propTypes = { members: React.PropTypes.array.isRequired, - memberCount: React.PropTypes.number.isRequired, + memberCount: React.PropTypes.number, channelId: React.PropTypes.string.isRequired }; diff --git a/web/react/components/post_attachment.jsx b/web/react/components/post_attachment.jsx index 2d6b47f03..cf65dfbfb 100644 --- a/web/react/components/post_attachment.jsx +++ b/web/react/components/post_attachment.jsx @@ -50,7 +50,8 @@ export default class PostAttachment extends React.Component { } shouldCollapse() { - return (this.props.attachment.text.match(/\n/g) || []).length >= 5 || this.props.attachment.text.length > 700; + const text = this.props.attachment.text || ''; + return (text.match(/\n/g) || []).length >= 5 || text.length > 700; } getCollapsedText() { @@ -292,4 +293,4 @@ export default class PostAttachment extends React.Component { PostAttachment.propTypes = { attachment: React.PropTypes.object.isRequired -};
\ No newline at end of file +}; diff --git a/web/react/components/search_autocomplete.jsx b/web/react/components/search_autocomplete.jsx index d245c6bac..04384203f 100644 --- a/web/react/components/search_autocomplete.jsx +++ b/web/react/components/search_autocomplete.jsx @@ -46,7 +46,7 @@ export default class SearchAutocomplete extends React.Component { componentDidUpdate(prevProps, prevState) { const content = $(ReactDOM.findDOMNode(this.refs.searchPopover)).find('.popover-content'); - if (this.state.show) { + if (this.state.show && this.state.suggestions.length > 0) { if (!prevState.show) { content.perfectScrollbar(); content.css('max-height', $(window).height() - 200); @@ -143,10 +143,12 @@ export default class SearchAutocomplete extends React.Component { } getSelection() { - if (this.state.mode === 'channels') { - return this.state.suggestions[this.state.selection].name; - } else if (this.state.mode === 'users') { - return this.state.suggestions[this.state.selection].username; + if (this.state.suggestions.length > 0) { + if (this.state.mode === 'channels') { + return this.state.suggestions[this.state.selection].name; + } else if (this.state.mode === 'users') { + return this.state.suggestions[this.state.selection].username; + } } return ''; diff --git a/web/react/components/settings_sidebar.jsx b/web/react/components/settings_sidebar.jsx index 68d9cea48..4af46c35a 100644 --- a/web/react/components/settings_sidebar.jsx +++ b/web/react/components/settings_sidebar.jsx @@ -1,14 +1,10 @@ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -var utils = require('../utils/utils.jsx'); export default class SettingsSidebar extends React.Component { componentDidUpdate() { $('.settings-modal').find('.modal-body').scrollTop(0); $('.settings-modal').find('.modal-body').perfectScrollbar('update'); - if (utils.isSafari()) { - $('.settings-modal .settings-links .nav').addClass('absolute'); - } } constructor(props) { super(props); |