Merge pull request #2556 from asaadmahmoodspin/ui-improvements

Multiple UI improvements
Этот коммит содержится в:
Harrison Healey
2016-03-29 12:09:22 -04:00
родитель 442376c40a 68fe7a9753
Коммит 9c36210edd
20 изменённых файлов: 74 добавлений и 31 удалений

Просмотреть файл

@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import SettingItemMin from './setting_item_min.jsx'; import SettingItemMin from './setting_item_min.jsx';
import SettingItemMax from './setting_item_max.jsx'; import SettingItemMax from './setting_item_max.jsx';
@@ -33,6 +34,7 @@ export default class ChannelNotificationsModal extends React.Component {
}; };
} }
updateSection(section) { updateSection(section) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
this.setState({activeSection: section}); this.setState({activeSection: section});
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {

Просмотреть файл

@@ -22,7 +22,7 @@ export default class PostInfo extends React.Component {
} }
dropdownPosition(e) { dropdownPosition(e) {
var position = $('#post-list').height() - $(e.target).offset().top; var position = $('#post-list').height() - $(e.target).offset().top;
var dropdown = $(e.target).next('.dropdown-menu'); var dropdown = $(e.target).closest('.col__reply').find('.dropdown-menu');
if (position < dropdown.height()) { if (position < dropdown.height()) {
dropdown.addClass('bottom'); dropdown.addClass('bottom');
} }

Просмотреть файл

@@ -570,7 +570,9 @@ function FloatingTimestamp({isScrolling, post}) {
return ( return (
<div className={className}> <div className={className}>
<span>{dateString}</span> <div>
<span>{dateString}</span>
</div>
</div> </div>
); );
} }

Просмотреть файл

@@ -84,6 +84,7 @@ class GeneralTab extends React.Component {
} }
updateSection(section) { updateSection(section) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
this.setState(this.setupInitialState(this.props)); this.setState(this.setupInitialState(this.props));
this.props.updateSection(section); this.props.updateSection(section);
} }

Просмотреть файл

@@ -62,6 +62,7 @@ class TeamSettingsModal extends React.Component {
} }
} }
updateSection(section) { updateSection(section) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
this.setState({activeSection: section}); this.setState({activeSection: section});
} }
render() { render() {

Просмотреть файл

@@ -131,7 +131,7 @@ export default class Textbox extends React.Component {
const helpText = ( const helpText = (
<div <div
style={{visibility: hasText ? 'visible' : 'hidden', opacity: hasText ? '0.5' : '0'}} style={{visibility: hasText ? 'visible' : 'hidden', opacity: hasText ? '0.5' : '0'}}
className='help_format_text' className='help__format-text'
> >
<b> <b>
<FormattedMessage <FormattedMessage
@@ -208,8 +208,8 @@ export default class Textbox extends React.Component {
dangerouslySetInnerHTML={{__html: this.state.preview ? TextFormatting.formatText(this.props.messageText) : ''}} dangerouslySetInnerHTML={{__html: this.state.preview ? TextFormatting.formatText(this.props.messageText) : ''}}
> >
</div> </div>
{helpText}
<div className='help__text'> <div className='help__text'>
{helpText}
{previewLink} {previewLink}
<a <a
target='_blank' target='_blank'

Просмотреть файл

@@ -7,6 +7,8 @@ import Constants from 'utils/constants.jsx';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl';
export default class PremadeThemeChooser extends React.Component { export default class PremadeThemeChooser extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
@@ -50,6 +52,17 @@ export default class PremadeThemeChooser extends React.Component {
return ( return (
<div className='row appearance-section'> <div className='row appearance-section'>
{premadeThemes} {premadeThemes}
<div className='col-sm-12 padding-bottom x2'>
<a
href='http://docs.mattermost.com/help/settings/theme-colors.html#custom-themes'
target='_blank'
>
<FormattedMessage
id='user.settings.display.theme.otherThemes'
defaultMessage='See other themes'
/>
</a>
</div>
</div> </div>
); );
} }

Просмотреть файл

@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMin from '../setting_item_min.jsx';
import SettingItemMax from '../setting_item_max.jsx'; import SettingItemMax from '../setting_item_max.jsx';
@@ -151,6 +152,7 @@ class AdvancedSettingsDisplay extends React.Component {
} }
updateSection(section) { updateSection(section) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
this.props.updateSection(section); this.props.updateSection(section);
} }

Просмотреть файл

@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery';
import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMin from '../setting_item_min.jsx';
import SettingItemMax from '../setting_item_max.jsx'; import SettingItemMax from '../setting_item_max.jsx';
import ManageLanguages from './manage_languages.jsx'; import ManageLanguages from './manage_languages.jsx';
@@ -83,6 +84,7 @@ export default class UserSettingsDisplay extends React.Component {
this.setState({selectedFont}); this.setState({selectedFont});
} }
updateSection(section) { updateSection(section) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
this.updateState(); this.updateState();
this.props.updateSection(section); this.props.updateSection(section);
} }

Просмотреть файл

@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery';
import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMin from '../setting_item_min.jsx';
import SettingItemMax from '../setting_item_max.jsx'; import SettingItemMax from '../setting_item_max.jsx';
import SettingPicture from '../setting_picture.jsx'; import SettingPicture from '../setting_picture.jsx';
@@ -286,6 +287,7 @@ class UserSettingsGeneralTab extends React.Component {
} }
} }
updateSection(section) { updateSection(section) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
const emailChangeInProgress = this.state.emailChangeInProgress; const emailChangeInProgress = this.state.emailChangeInProgress;
this.setState(Object.assign({}, this.setupInitialState(this.props), {emailChangeInProgress, clientError: '', serverError: '', emailError: ''})); this.setState(Object.assign({}, this.setupInitialState(this.props), {emailChangeInProgress, clientError: '', serverError: '', emailError: ''}));
this.submitActive = false; this.submitActive = false;

Просмотреть файл

@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery';
import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMin from '../setting_item_min.jsx';
import SettingItemMax from '../setting_item_max.jsx'; import SettingItemMax from '../setting_item_max.jsx';
import ManageIncomingHooks from './manage_incoming_hooks.jsx'; import ManageIncomingHooks from './manage_incoming_hooks.jsx';
@@ -47,6 +48,7 @@ class UserSettingsIntegrationsTab extends React.Component {
this.state = {}; this.state = {};
} }
updateSection(section) { updateSection(section) {
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
this.props.updateSection(section); this.props.updateSection(section);
} }
render() { render() {

Просмотреть файл

@@ -1,6 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMin from '../setting_item_min.jsx';
import SettingItemMax from '../setting_item_max.jsx'; import SettingItemMax from '../setting_item_max.jsx';
@@ -162,6 +163,7 @@ class NotificationsTab extends React.Component {
this.updateState(); this.updateState();
this.props.updateSection(''); this.props.updateSection('');
e.preventDefault(); e.preventDefault();
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
} }
updateSection(section) { updateSection(section) {
this.updateState(); this.updateState();

Просмотреть файл

@@ -204,6 +204,7 @@ class SecurityTab extends React.Component {
this.props.updateSection(''); this.props.updateSection('');
this.setState({currentPassword: '', newPassword: '', confirmPassword: '', serverError: null, passwordError: null}); this.setState({currentPassword: '', newPassword: '', confirmPassword: '', serverError: null, passwordError: null});
e.preventDefault(); e.preventDefault();
$('.settings-modal .modal-body').scrollTop(0).perfectScrollbar('update');
}.bind(this); }.bind(this);
return ( return (

Просмотреть файл

@@ -1238,6 +1238,7 @@
"user.settings.display.theme.customTheme": "Custom Theme", "user.settings.display.theme.customTheme": "Custom Theme",
"user.settings.display.theme.describe": "Open to manage your theme", "user.settings.display.theme.describe": "Open to manage your theme",
"user.settings.display.theme.import": "Import theme colors from Slack", "user.settings.display.theme.import": "Import theme colors from Slack",
"user.settings.display.theme.otherThemes": "See other themes",
"user.settings.display.theme.themeColors": "Theme Colors", "user.settings.display.theme.themeColors": "Theme Colors",
"user.settings.display.theme.title": "Theme", "user.settings.display.theme.title": "Theme",
"user.settings.display.title": "Display Settings", "user.settings.display.title": "Display Settings",

Просмотреть файл

@@ -66,6 +66,7 @@ body.ios {
font-size: 13px; font-size: 13px;
position: absolute; position: absolute;
right: 0; right: 0;
text-align: right;
z-index: 3; z-index: 3;
} }
@@ -74,16 +75,14 @@ body.ios {
} }
} }
.help_format_text { .help__format-text {
@include opacity(0); @include opacity(0);
@include single-transition(all .2s ease); @include single-transition(all .2s ease);
bottom: -23px; display: inline-block;
display: none !important;
font-size: .85em; font-size: .85em;
left: 0; margin-right: 10px;
overflow: hidden; vertical-align: bottom;
position: absolute; white-space: nowrap;
text-overflow: ellipsis;
b, b,
i, i,
@@ -275,39 +274,36 @@ body.ios {
outline: none; outline: none;
text-align: center; text-align: center;
} }
.beginning-messages-text {
color: grey;
display: block;
margin-bottom: 5px;
margin-top: 2px;
text-align: center;
}
} }
.post-list__timestamp { .post-list__timestamp {
@include border-radius(3px);
@include opacity(0); @include opacity(0);
@include single-transition(all, .6s, ease); @include single-transition(all, .6s, ease);
@include translateY(-45px); @include translateY(-45px);
@include font-smoothing(initial);
background: $primary-color;
color: $white;
display: none; display: none;
font-size: 12px; left: 0;
left: 50%;
line-height: 25px;
margin-left: -60px;
position: absolute; position: absolute;
text-align: center; text-align: center;
top: 8px; top: 8px;
width: 120px; width: 100%;
z-index: 50; z-index: 50;
&.scrolling { &.scrolling {
@include translateY(0); @include translateY(0);
@include opacity(.8); @include opacity(.8);
} }
> div {
@include border-radius(3px);
@include font-smoothing(initial);
background: $primary-color;
color: $white;
display: inline-block;
font-size: 12px;
line-height: 25px;
padding: 0 8px;
text-align: center;
}
} }
.post-list__arrows { .post-list__arrows {

Просмотреть файл

@@ -25,6 +25,10 @@
} }
} }
.help__format-text {
display: none;
}
.sidebar--right__content { .sidebar--right__content {
@include display-flex; @include display-flex;
@include flex-direction(column); @include flex-direction(column);

Просмотреть файл

@@ -17,6 +17,14 @@
} }
@media screen and (max-width: 1440px) { @media screen and (max-width: 1440px) {
.inner-wrap {
&.move--left {
.help__format-text {
display: none;
}
}
}
.date-separator, .date-separator,
.new-separator { .new-separator {
&.hovered--comment { &.hovered--comment {

Просмотреть файл

@@ -15,6 +15,10 @@
} }
} }
.help__format-text {
display: none;
}
.inner-wrap { .inner-wrap {
&.move--left { &.move--left {
margin-right: 0; margin-right: 0;

Просмотреть файл

@@ -200,7 +200,7 @@
display: block; display: block;
height: 40px; height: 40px;
line-height: 34px; line-height: 34px;
margin: 1em 1rem; margin: 1em 0;
min-width: 200px; min-width: 200px;
padding: 0 1em; padding: 0 1em;
width: 200px; width: 200px;

Просмотреть файл

@@ -651,7 +651,7 @@ export function applyTheme(theme) {
} }
if (theme.sidebarHeaderBg) { if (theme.sidebarHeaderBg) {
changeCss('.sidebar--left .team__header, .sidebar--menu .team__header, .post-list__timestamp', 'background:' + theme.sidebarHeaderBg, 1); changeCss('.sidebar--left .team__header, .sidebar--menu .team__header, .post-list__timestamp > div', 'background:' + theme.sidebarHeaderBg, 1);
changeCss('.modal .modal-header', 'background:' + theme.sidebarHeaderBg, 1); changeCss('.modal .modal-header', 'background:' + theme.sidebarHeaderBg, 1);
changeCss('#navbar .navbar-default', 'background:' + theme.sidebarHeaderBg, 1); changeCss('#navbar .navbar-default', 'background:' + theme.sidebarHeaderBg, 1);
changeCss('@media(max-width: 768px){.search-bar__container', 'background:' + theme.sidebarHeaderBg, 1); changeCss('@media(max-width: 768px){.search-bar__container', 'background:' + theme.sidebarHeaderBg, 1);
@@ -659,7 +659,7 @@ export function applyTheme(theme) {
} }
if (theme.sidebarHeaderTextColor) { if (theme.sidebarHeaderTextColor) {
changeCss('.sidebar--left .team__header .header__info, .sidebar--menu .team__header .header__info, .post-list__timestamp', 'color:' + theme.sidebarHeaderTextColor, 1); changeCss('.sidebar--left .team__header .header__info, .sidebar--menu .team__header .header__info, .post-list__timestamp > div', 'color:' + theme.sidebarHeaderTextColor, 1);
changeCss('.sidebar--left .team__header .navbar-right .dropdown__icon, .sidebar--menu .team__header .navbar-right .dropdown__icon', 'fill:' + theme.sidebarHeaderTextColor, 1); changeCss('.sidebar--left .team__header .navbar-right .dropdown__icon, .sidebar--menu .team__header .navbar-right .dropdown__icon', 'fill:' + theme.sidebarHeaderTextColor, 1);
changeCss('.sidebar--left .team__header .user__name, .sidebar--menu .team__header .user__name', 'color:' + changeOpacity(theme.sidebarHeaderTextColor, 0.8), 1); changeCss('.sidebar--left .team__header .user__name, .sidebar--menu .team__header .user__name', 'color:' + changeOpacity(theme.sidebarHeaderTextColor, 0.8), 1);
changeCss('.sidebar--left .team__header:hover .user__name, .sidebar--menu .team__header:hover .user__name', 'color:' + theme.sidebarHeaderTextColor, 1); changeCss('.sidebar--left .team__header:hover .user__name, .sidebar--menu .team__header:hover .user__name', 'color:' + theme.sidebarHeaderTextColor, 1);