Merge pull request #2171 from asaadmahmoodspin/ui-fixes

Multiple UI Improvements
Этот коммит содержится в:
Joram Wilander
2016-02-16 08:19:19 -05:00
родитель 2ec3762fb2 44fa72066b
Коммит 6ffcfaa2f3
9 изменённых файлов: 213 добавлений и 18 удалений

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

@@ -14,9 +14,17 @@ export default class PostInfo extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.dropdownPosition = this.dropdownPosition.bind(this);
this.handlePermalink = this.handlePermalink.bind(this); this.handlePermalink = this.handlePermalink.bind(this);
this.removePost = this.removePost.bind(this); this.removePost = this.removePost.bind(this);
} }
dropdownPosition(e) {
var position = $('#post-list').height() - $(e.target).offset().top;
var dropdown = $(e.target).next('.dropdown-menu');
if (position < dropdown.height()) {
dropdown.addClass('bottom');
}
}
createDropdown() { createDropdown() {
var post = this.props.post; var post = this.props.post;
var isOwner = UserStore.getCurrentId() === post.user_id; var isOwner = UserStore.getCurrentId() === post.user_id;
@@ -133,6 +141,7 @@ export default class PostInfo extends React.Component {
type='button' type='button'
data-toggle='dropdown' data-toggle='dropdown'
aria-expanded='false' aria-expanded='false'
onClick={this.dropdownPosition}
/> />
<ul <ul
className='dropdown-menu' className='dropdown-menu'

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

@@ -102,6 +102,7 @@ class CustomThemeChooser extends React.Component {
this.onPickerChange = this.onPickerChange.bind(this); this.onPickerChange = this.onPickerChange.bind(this);
this.onInputChange = this.onInputChange.bind(this); this.onInputChange = this.onInputChange.bind(this);
this.pasteBoxChange = this.pasteBoxChange.bind(this); this.pasteBoxChange = this.pasteBoxChange.bind(this);
this.toggleContent = this.toggleContent.bind(this);
this.state = {}; this.state = {};
} }
@@ -153,11 +154,23 @@ class CustomThemeChooser extends React.Component {
this.props.updateTheme(theme); this.props.updateTheme(theme);
} }
toggleContent(e) {
e.stopPropagation();
if ($(e.target).hasClass('theme-elements__header')) {
$(e.target).next().slideToggle();
$(e.target).toggleClass('open');
} else {
$(e.target).closest('.theme-elements__header').next().slideToggle();
$(e.target).closest('.theme-elements__header').toggleClass('open');
}
}
render() { render() {
const {formatMessage} = this.props.intl; const {formatMessage} = this.props.intl;
const theme = this.props.theme; const theme = this.props.theme;
const elements = []; const sidebarElements = [];
const centerChannelElements = [];
const linkAndButtonElements = [];
let colors = ''; let colors = '';
Constants.THEME_ELEMENTS.forEach((element, index) => { Constants.THEME_ELEMENTS.forEach((element, index) => {
if (element.id === 'codeTheme') { if (element.id === 'codeTheme') {
@@ -187,9 +200,9 @@ class CustomThemeChooser extends React.Component {
</Popover> </Popover>
); );
elements.push( centerChannelElements.push(
<div <div
className='col-sm-4 form-group' className='col-sm-6 form-group'
key={'custom-theme-key' + index} key={'custom-theme-key' + index}
> >
<label className='custom-label'>{formatMessage(messages[element.id])}</label> <label className='custom-label'>{formatMessage(messages[element.id])}</label>
@@ -219,10 +232,54 @@ class CustomThemeChooser extends React.Component {
</div> </div>
</div> </div>
); );
} else { } else if (element.group === 'centerChannelElements') {
elements.push( centerChannelElements.push(
<div <div
className='col-sm-4 form-group element' className='col-sm-6 form-group element'
key={'custom-theme-key' + index}
>
<label className='custom-label'>{formatMessage(messages[element.id])}</label>
<div
className='input-group color-picker'
id={element.id}
>
<input
className='form-control'
type='text'
value={theme[element.id]}
onChange={this.onInputChange}
/>
<span className='input-group-addon'><i></i></span>
</div>
</div>
);
} else if (element.group === 'sidebarElements') {
sidebarElements.push(
<div
className='col-sm-6 form-group element'
key={'custom-theme-key' + index}
>
<label className='custom-label'>{formatMessage(messages[element.id])}</label>
<div
className='input-group color-picker'
id={element.id}
>
<input
className='form-control'
type='text'
value={theme[element.id]}
onChange={this.onInputChange}
/>
<span className='input-group-addon'><i></i></span>
</div>
</div>
);
colors += theme[element.id] + ',';
} else {
linkAndButtonElements.push(
<div
className='col-sm-6 form-group element'
key={'custom-theme-key' + index} key={'custom-theme-key' + index}
> >
<label className='custom-label'>{formatMessage(messages[element.id])}</label> <label className='custom-label'>{formatMessage(messages[element.id])}</label>
@@ -265,9 +322,51 @@ class CustomThemeChooser extends React.Component {
); );
return ( return (
<div className='appearance-section'> <div className='appearance-section padding-top'>
<div className='theme-elements row'>
<div
className='theme-elements__header'
onClick={this.toggleContent}
>
{'Sidebar Styles'}
<div className='header__icon'>
<i className='fa fa-plus'></i>
<i className='fa fa-minus'></i>
</div>
</div>
<div className='theme-elements__body'>
{sidebarElements}
</div>
</div>
<div className='theme-elements row'>
<div
className='theme-elements__header'
onClick={this.toggleContent}
>
{'Center Channel Styles'}
<div className='header__icon'>
<i className='fa fa-plus'></i>
<i className='fa fa-minus'></i>
</div>
</div>
<div className='theme-elements__body'>
{centerChannelElements}
</div>
</div>
<div className='theme-elements row form-group'> <div className='theme-elements row form-group'>
{elements} <div
className='theme-elements__header'
onClick={this.toggleContent}
>
{'Link and Button Styles'}
<div className='header__icon'>
<i className='fa fa-plus'></i>
<i className='fa fa-minus'></i>
</div>
</div>
<div className='theme-elements__body'>
{linkAndButtonElements}
</div>
</div> </div>
<div className='row'> <div className='row'>
{pasteBox} {pasteBox}

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

@@ -182,7 +182,6 @@ export default class ThemeSetting extends React.Component {
if (displayCustom) { if (displayCustom) {
custom = ( custom = (
<div key='customThemeChooser'> <div key='customThemeChooser'>
<br/>
<CustomThemeChooser <CustomThemeChooser
theme={this.state.theme} theme={this.state.theme}
updateTheme={this.updateTheme} updateTheme={this.updateTheme}
@@ -241,7 +240,6 @@ export default class ThemeSetting extends React.Component {
defaultMessage='Custom Theme' defaultMessage='Custom Theme'
/> />
</label> </label>
<br/>
</div> </div>
); );

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

@@ -189,8 +189,8 @@ export default {
sidebarHeaderTextColor: '#FFFFFF', sidebarHeaderTextColor: '#FFFFFF',
onlineIndicator: '#7DBE00', onlineIndicator: '#7DBE00',
awayIndicator: '#DCBD4E', awayIndicator: '#DCBD4E',
mentionBj: '#136197', mentionBj: '#FBFBFB',
mentionColor: '#bfcde8', mentionColor: '#2071A7',
centerChannelBg: '#f2f4f8', centerChannelBg: '#f2f4f8',
centerChannelColor: '#333333', centerChannelColor: '#333333',
newMessageSeparator: '#FF8800', newMessageSeparator: '#FF8800',
@@ -276,86 +276,107 @@ export default {
}, },
THEME_ELEMENTS: [ THEME_ELEMENTS: [
{ {
group: 'sidebarElements',
id: 'sidebarBg', id: 'sidebarBg',
uiName: 'Sidebar BG' uiName: 'Sidebar BG'
}, },
{ {
group: 'sidebarElements',
id: 'sidebarText', id: 'sidebarText',
uiName: 'Sidebar Text' uiName: 'Sidebar Text'
}, },
{ {
group: 'sidebarElements',
id: 'sidebarHeaderBg', id: 'sidebarHeaderBg',
uiName: 'Sidebar Header BG' uiName: 'Sidebar Header BG'
}, },
{ {
group: 'sidebarElements',
id: 'sidebarHeaderTextColor', id: 'sidebarHeaderTextColor',
uiName: 'Sidebar Header Text' uiName: 'Sidebar Header Text'
}, },
{ {
group: 'sidebarElements',
id: 'sidebarUnreadText', id: 'sidebarUnreadText',
uiName: 'Sidebar Unread Text' uiName: 'Sidebar Unread Text'
}, },
{ {
group: 'sidebarElements',
id: 'sidebarTextHoverBg', id: 'sidebarTextHoverBg',
uiName: 'Sidebar Text Hover BG' uiName: 'Sidebar Text Hover BG'
}, },
{ {
group: 'sidebarElements',
id: 'sidebarTextActiveBorder', id: 'sidebarTextActiveBorder',
uiName: 'Sidebar Text Active Border' uiName: 'Sidebar Text Active Border'
}, },
{ {
group: 'sidebarElements',
id: 'sidebarTextActiveColor', id: 'sidebarTextActiveColor',
uiName: 'Sidebar Text Active Color' uiName: 'Sidebar Text Active Color'
}, },
{ {
group: 'sidebarElements',
id: 'onlineIndicator', id: 'onlineIndicator',
uiName: 'Online Indicator' uiName: 'Online Indicator'
}, },
{ {
group: 'sidebarElements',
id: 'awayIndicator', id: 'awayIndicator',
uiName: 'Away Indicator' uiName: 'Away Indicator'
}, },
{ {
group: 'sidebarElements',
id: 'mentionBj', id: 'mentionBj',
uiName: 'Mention Jewel BG' uiName: 'Mention Jewel BG'
}, },
{ {
group: 'sidebarElements',
id: 'mentionColor', id: 'mentionColor',
uiName: 'Mention Jewel Text' uiName: 'Mention Jewel Text'
}, },
{ {
group: 'centerChannelElements',
id: 'centerChannelBg', id: 'centerChannelBg',
uiName: 'Center Channel BG' uiName: 'Center Channel BG'
}, },
{ {
group: 'centerChannelElements',
id: 'centerChannelColor', id: 'centerChannelColor',
uiName: 'Center Channel Text' uiName: 'Center Channel Text'
}, },
{ {
group: 'centerChannelElements',
id: 'newMessageSeparator', id: 'newMessageSeparator',
uiName: 'New Message Separator' uiName: 'New Message Separator'
}, },
{ {
group: 'linkAndButtonElements',
id: 'linkColor', id: 'linkColor',
uiName: 'Link Color' uiName: 'Link Color'
}, },
{ {
group: 'linkAndButtonElements',
id: 'buttonBg', id: 'buttonBg',
uiName: 'Button BG' uiName: 'Button BG'
}, },
{ {
group: 'linkAndButtonElements',
id: 'buttonColor', id: 'buttonColor',
uiName: 'Button Text' uiName: 'Button Text'
}, },
{ {
group: 'centerChannelElements',
id: 'mentionHighlightBg', id: 'mentionHighlightBg',
uiName: 'Mention Highlight BG' uiName: 'Mention Highlight BG'
}, },
{ {
group: 'centerChannelElements',
id: 'mentionHighlightLink', id: 'mentionHighlightLink',
uiName: 'Mention Highlight Link' uiName: 'Mention Highlight Link'
}, },
{ {
group: 'centerChannelElements',
id: 'codeTheme', id: 'codeTheme',
uiName: 'Code Theme', uiName: 'Code Theme',
themes: [ themes: [

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

@@ -743,7 +743,7 @@ export function applyTheme(theme) {
changeCss('.date-separator .separator__hr, .modal-footer, .modal .custom-textarea', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.date-separator .separator__hr, .modal-footer, .modal .custom-textarea', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.search-item-container, .post-right__container .post.post--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.1), 1); changeCss('.search-item-container, .post-right__container .post.post--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.1), 1);
changeCss('.modal .custom-textarea:focus', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.3), 1); changeCss('.modal .custom-textarea:focus', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.3), 1);
changeCss('.channel-intro, .settings-modal .settings-table .settings-content .divider-dark, hr, .settings-modal .settings-table .settings-links', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1); changeCss('.channel-intro, .settings-modal .settings-table .settings-content .divider-dark, hr, .settings-modal .settings-table .settings-links, .settings-modal .settings-table .settings-content .appearance-section .theme-elements__header', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
changeCss('.post.current--user .post__body, .post.post--comment.other--root.current--user .post-comment, pre, .post-right__container .post.post--root', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.post.current--user .post__body, .post.post--comment.other--root.current--user .post-comment, pre, .post-right__container .post.post--root', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
changeCss('.post.current--user .post__body, .post.post--comment.other--root.current--user .post-comment, .post.same--root.post--comment .post__body, .modal .more-table tbody>tr td, .member-div:first-child, .member-div, .access-history__table .access__report, .activity-log__table', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.1), 2); changeCss('.post.current--user .post__body, .post.post--comment.other--root.current--user .post-comment, .post.same--root.post--comment .post__body, .modal .more-table tbody>tr td, .member-div:first-child, .member-div, .access-history__table .access__report, .activity-log__table', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.1), 2);
changeCss('@media(max-width: 1800px){.inner__wrap.move--left .post.post--comment.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2); changeCss('@media(max-width: 1800px){.inner__wrap.move--left .post.post--comment.same--root', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.07), 2);
@@ -753,7 +753,7 @@ export function applyTheme(theme) {
changeCss('code', 'background:' + changeOpacity(theme.centerChannelColor, 0.1), 1); changeCss('code', 'background:' + changeOpacity(theme.centerChannelColor, 0.1), 1);
changeCss('@media(min-width: 960px){.post.current--user:hover .post__body ', 'background: none;', 1); changeCss('@media(min-width: 960px){.post.current--user:hover .post__body ', 'background: none;', 1);
changeCss('.sidebar--right', 'color:' + theme.centerChannelColor, 2); changeCss('.sidebar--right', 'color:' + theme.centerChannelColor, 2);
changeCss('.search-help-popover .search-autocomplete__item:hover', 'background:' + changeOpacity(theme.centerChannelColor, 0.05), 1); changeCss('.search-help-popover .search-autocomplete__item:hover, .settings-modal .settings-table .settings-content .appearance-section .theme-elements__body', 'background:' + changeOpacity(theme.centerChannelColor, 0.05), 1);
changeCss('.search-help-popover .search-autocomplete__item.selected', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1); changeCss('.search-help-popover .search-autocomplete__item.selected', 'background:' + changeOpacity(theme.centerChannelColor, 0.15), 1);
} }

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

@@ -396,8 +396,8 @@ body.ios {
.post-list__content { .post-list__content {
display: table-cell; display: table-cell;
vertical-align: bottom; vertical-align: bottom;
> div:last-child { .dropdown-menu {
.dropdown-menu { &.bottom {
top: auto; top: auto;
bottom: 25px; bottom: 25px;
} }

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

@@ -11,7 +11,15 @@
.post-right-comments-container { .post-right-comments-container {
position: relative; position: relative;
padding: 0.7em 0 0;
.post {
&:first-child {
padding-top: 15px;
}
}
} }
.post { .post {
@@ -19,6 +27,11 @@
&.post--root { &.post--root {
padding-bottom: 1.2em; padding-bottom: 1.2em;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
.post__body {
background: transparent !important;
}
} }
.post__header { .post__header {

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

@@ -92,12 +92,14 @@
font-size: 1em; font-size: 1em;
} }
.date-separator.hovered--after:before, .new-separator.hovered--after:before { .date-separator.hovered--before:after, .date-separator.hovered--after:before, .new-separator.hovered--after:before, .new-separator.hovered--before:after {
background: none !important; background: none !important;
} }
.post { .post {
background: none !important;
.post__dropdown { .post__dropdown {
line-height: 9px; line-height: 9px;
text-decoration: none; text-decoration: none;
@@ -114,6 +116,10 @@
} }
.comment-icon__container {
visibility: visible;
}
.post-list__content & { .post-list__content & {
&:hover { &:hover {

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

@@ -144,7 +144,11 @@
select { select {
padding-right: 25px; padding-right: 25px;
} }
select::-ms-expand {
display: none;
}
&:before { &:before {
pointer-events: none;
position: absolute; position: absolute;
top: 11px; top: 11px;
right: 50px; right: 50px;
@@ -181,12 +185,57 @@
.theme-elements { .theme-elements {
padding-left:15px; padding-left:15px;
.element { .element {
margin-right:10px; margin-right:10px;
&:nth-child(2n) {
margin-right: 0;
}
} }
} }
.theme-elements__header {
margin: 10px 20px 0px 0;
border-bottom: 1px solid #ccc;
padding: 5px 0 10px;
font-size: em(13.5px);
font-weight: 600;
cursor: pointer;
.fa-minus {
display: none;
}
&.open {
.fa-minus {
display: inline-block;
}
.fa-plus {
display: none;
}
}
.header__icon {
float: right;
@include opacity(0.5);
}
}
.theme-elements__body {
padding-top: 5px;
display: none;
@include legacy-pie-clearfix;
background: rgba(255, 255, 255, 0.05);
padding: 20px 0 0 20px;
margin: 0 20px 0 0;
@include border-radius(0 0 3px 3px);
}
.custom-label { .custom-label {
white-space: nowrap;
font-weight: normal; font-weight: normal;
font-size: 12px; font-size: 12px;
width: 100%; width: 100%;