Merge pull request #1046 from asaadmahmoodspin/ui-improvements
Multiple UI Improvements
Этот коммит содержится в:
@@ -192,9 +192,12 @@ export default class CreatePost extends React.Component {
|
|||||||
PostStore.storeCurrentDraft(draft);
|
PostStore.storeCurrentDraft(draft);
|
||||||
}
|
}
|
||||||
resizePostHolder() {
|
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`);
|
$('.post-list-holder-by-time').css('height', `${height}px`);
|
||||||
$(window).trigger('resize');
|
$(window).trigger('resize');
|
||||||
|
if ($(window).width() > 960) {
|
||||||
|
$('#post_textbox').focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
handleUploadStart(clientIds, channelId) {
|
handleUploadStart(clientIds, channelId) {
|
||||||
const draft = PostStore.getDraft(channelId);
|
const draft = PostStore.getDraft(channelId);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ export default class ErrorBar extends React.Component {
|
|||||||
|
|
||||||
this.onErrorChange = this.onErrorChange.bind(this);
|
this.onErrorChange = this.onErrorChange.bind(this);
|
||||||
this.handleClose = this.handleClose.bind(this);
|
this.handleClose = this.handleClose.bind(this);
|
||||||
this.resize = this.resize.bind(this);
|
|
||||||
this.prevTimer = null;
|
this.prevTimer = null;
|
||||||
|
|
||||||
this.state = ErrorStore.getLastError();
|
this.state = ErrorStore.getLastError();
|
||||||
@@ -46,34 +45,14 @@ export default class ErrorBar extends React.Component {
|
|||||||
return false;
|
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() {
|
componentDidMount() {
|
||||||
ErrorStore.addChangeListener(this.onErrorChange);
|
ErrorStore.addChangeListener(this.onErrorChange);
|
||||||
|
|
||||||
$(window).resize(() => {
|
|
||||||
this.resize();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.resize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
ErrorStore.removeChangeListener(this.onErrorChange);
|
ErrorStore.removeChangeListener(this.onErrorChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
|
||||||
this.resize();
|
|
||||||
}
|
|
||||||
|
|
||||||
onErrorChange() {
|
onErrorChange() {
|
||||||
var newState = ErrorStore.getLastError();
|
var newState = ErrorStore.getLastError();
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ export default class PostInfo extends React.Component {
|
|||||||
<ul className='post-header post-info'>
|
<ul className='post-header post-info'>
|
||||||
<li className='post-header-col'>
|
<li className='post-header-col'>
|
||||||
<OverlayTrigger
|
<OverlayTrigger
|
||||||
|
delayShow='500'
|
||||||
container={this}
|
container={this}
|
||||||
placement='top'
|
placement='top'
|
||||||
overlay={tooltip}
|
overlay={tooltip}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ const TeamStore = require('../stores/team_store.jsx');
|
|||||||
const UnreadChannelIndicator = require('./unread_channel_indicator.jsx');
|
const UnreadChannelIndicator = require('./unread_channel_indicator.jsx');
|
||||||
const UserStore = require('../stores/user_store.jsx');
|
const UserStore = require('../stores/user_store.jsx');
|
||||||
const Utils = require('../utils/utils.jsx');
|
const Utils = require('../utils/utils.jsx');
|
||||||
|
const Tooltip = ReactBootstrap.Tooltip;
|
||||||
|
const OverlayTrigger = ReactBootstrap.OverlayTrigger;
|
||||||
|
|
||||||
export default class Sidebar extends React.Component {
|
export default class Sidebar extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -455,14 +457,21 @@ export default class Sidebar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let closeButton = null;
|
let closeButton = null;
|
||||||
|
const removeTooltip = <Tooltip>{'Remove from list'}</Tooltip>;
|
||||||
if (handleClose && !badge) {
|
if (handleClose && !badge) {
|
||||||
closeButton = (
|
closeButton = (
|
||||||
|
<OverlayTrigger
|
||||||
|
delayShow='1000'
|
||||||
|
placement='top'
|
||||||
|
overlay={removeTooltip}
|
||||||
|
>
|
||||||
<span
|
<span
|
||||||
className='close-btn pull-right small'
|
className='btn-close'
|
||||||
data-close='true'
|
data-close='true'
|
||||||
>
|
>
|
||||||
{'×'}
|
{'×'}
|
||||||
</span>
|
</span>
|
||||||
|
</OverlayTrigger>
|
||||||
);
|
);
|
||||||
|
|
||||||
rowClass = ' has-close';
|
rowClass = ' has-close';
|
||||||
@@ -545,6 +554,9 @@ export default class Sidebar extends React.Component {
|
|||||||
showChannelModal = true;
|
showChannelModal = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const createChannelTootlip = <Tooltip>{'Create new channel'}</Tooltip>;
|
||||||
|
const createGroupTootlip = <Tooltip>{'Create new group'}</Tooltip>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<NewChannelFlow
|
<NewChannelFlow
|
||||||
@@ -579,6 +591,11 @@ export default class Sidebar extends React.Component {
|
|||||||
<li>
|
<li>
|
||||||
<h4>
|
<h4>
|
||||||
{'Channels'}
|
{'Channels'}
|
||||||
|
<OverlayTrigger
|
||||||
|
delayShow='500'
|
||||||
|
placement='top'
|
||||||
|
overlay={createChannelTootlip}
|
||||||
|
>
|
||||||
<a
|
<a
|
||||||
className='add-channel-btn'
|
className='add-channel-btn'
|
||||||
href='#'
|
href='#'
|
||||||
@@ -586,6 +603,7 @@ export default class Sidebar extends React.Component {
|
|||||||
>
|
>
|
||||||
{'+'}
|
{'+'}
|
||||||
</a>
|
</a>
|
||||||
|
</OverlayTrigger>
|
||||||
</h4>
|
</h4>
|
||||||
</li>
|
</li>
|
||||||
{publicChannelItems}
|
{publicChannelItems}
|
||||||
@@ -606,6 +624,11 @@ export default class Sidebar extends React.Component {
|
|||||||
<li>
|
<li>
|
||||||
<h4>
|
<h4>
|
||||||
{'Private Groups'}
|
{'Private Groups'}
|
||||||
|
<OverlayTrigger
|
||||||
|
delayShow='500'
|
||||||
|
placement='top'
|
||||||
|
overlay={createGroupTootlip}
|
||||||
|
>
|
||||||
<a
|
<a
|
||||||
className='add-channel-btn'
|
className='add-channel-btn'
|
||||||
href='#'
|
href='#'
|
||||||
@@ -613,6 +636,7 @@ export default class Sidebar extends React.Component {
|
|||||||
>
|
>
|
||||||
{'+'}
|
{'+'}
|
||||||
</a>
|
</a>
|
||||||
|
</OverlayTrigger>
|
||||||
</h4>
|
</h4>
|
||||||
</li>
|
</li>
|
||||||
{privateChannelItems}
|
{privateChannelItems}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default class UserProfile extends React.Component {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserStore.addChangeListener(this.onChange);
|
UserStore.addChangeListener(this.onChange);
|
||||||
if (!this.props.disablePopover) {
|
if (!this.props.disablePopover) {
|
||||||
$('#profile_' + this.uniqueId).popover({placement: 'right', container: 'body', trigger: 'hover', html: true, delay: {show: 200, hide: 100}});
|
$('#profile_' + this.uniqueId).popover({placement: 'right', container: 'body', trigger: 'click hover', html: true, delay: {show: 200, hide: 100}});
|
||||||
$('body').tooltip({selector: '[data-toggle=tooltip]', trigger: 'hover click'});
|
$('body').tooltip({selector: '[data-toggle=tooltip]', trigger: 'hover click'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -473,6 +473,8 @@ export function applyTheme(theme) {
|
|||||||
if (theme.centerChannelColor) {
|
if (theme.centerChannelColor) {
|
||||||
changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .command-name, .modal .modal-content, .dropdown-menu, .popover, .mentions-name', 'color:' + theme.centerChannelColor, 1);
|
changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .command-name, .modal .modal-content, .dropdown-menu, .popover, .mentions-name', 'color:' + theme.centerChannelColor, 1);
|
||||||
changeCss('#post-create', 'color:' + theme.centerChannelColor, 2);
|
changeCss('#post-create', 'color:' + theme.centerChannelColor, 2);
|
||||||
|
changeCss('.channel-header__links a', 'fill:' + changeOpacity(theme.centerChannelColor, 0.7), 1);
|
||||||
|
changeCss('.channel-header__links a:hover, .channel-header__links a:active', 'fill:' + theme.centerChannelColor, 2);
|
||||||
changeCss('.mentions--top, .command-box', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3);
|
changeCss('.mentions--top, .command-box', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 3);
|
||||||
changeCss('.mentions--top, .command-box', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2);
|
changeCss('.mentions--top, .command-box', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 2);
|
||||||
changeCss('.mentions--top, .command-box', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 1);
|
changeCss('.mentions--top, .command-box', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.2) + ' 1px -3px 12px', 1);
|
||||||
@@ -485,6 +487,10 @@ export function applyTheme(theme) {
|
|||||||
changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
|
changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
|
||||||
changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
|
changeCss('.channel-header #member_popover', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
|
||||||
changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box, .modal .modal-content, .settings-modal .settings-table .settings-content .divider-light, .dropdown-menu, .modal .modal-header, .popover, .mentions--top .mentions-box', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
|
changeCss('.custom-textarea, .custom-textarea:focus, .preview-container .preview-div, .post-image__column .post-image__details, .sidebar--right .sidebar-right__body, .markdown__table th, .markdown__table td, .command-box, .modal .modal-content, .settings-modal .settings-table .settings-content .divider-light, .dropdown-menu, .modal .modal-header, .popover, .mentions--top .mentions-box', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
|
||||||
|
changeCss('.popover.bottom>.arrow', 'border-bottom-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
|
||||||
|
changeCss('.popover.right>.arrow', 'border-right-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
|
||||||
|
changeCss('.popover.left>.arrow', 'border-left-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
|
||||||
|
changeCss('.popover.top>.arrow', 'border-top-color:' + changeOpacity(theme.centerChannelColor, 0.25), 1);
|
||||||
changeCss('.command-name, .popover .popover-title', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
|
changeCss('.command-name, .popover .popover-title', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
|
||||||
changeCss('.dropdown-menu .divider', 'background:' + theme.centerChannelColor, 1);
|
changeCss('.dropdown-menu .divider', 'background:' + theme.centerChannelColor, 1);
|
||||||
changeCss('.custom-textarea', 'color:' + theme.centerChannelColor, 1);
|
changeCss('.custom-textarea', 'color:' + theme.centerChannelColor, 1);
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ img {
|
|||||||
|
|
||||||
.popover {
|
.popover {
|
||||||
color: #333;
|
color: #333;
|
||||||
&.bottom {
|
&.bottom, &.right, &.top, &.left {
|
||||||
>.arrow:after {
|
>.arrow:after {
|
||||||
border-bottom-color: rgba(white, 0.5);
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.popover-title {
|
.popover-title {
|
||||||
@@ -83,6 +83,9 @@ a:focus, a:hover {
|
|||||||
.tooltip {
|
.tooltip {
|
||||||
.tooltip-inner {
|
.tooltip-inner {
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
|
font-size: 13px;
|
||||||
|
padding: 3px 10px 4px;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 6;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.post-list {
|
.post-list {
|
||||||
.new-messages-hr {
|
.new-messages-hr {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
text-align:center;
|
text-align:center;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
position: fixed;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
|||||||
@@ -40,5 +40,6 @@
|
|||||||
|
|
||||||
.help-block {
|
.help-block {
|
||||||
font-size: 0.95em;
|
font-size: 0.95em;
|
||||||
|
margin: 10px 0 0;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,11 +291,6 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 15px;
|
width: 15px;
|
||||||
margin: 9px 6px 3px 0;
|
margin: 9px 6px 3px 0;
|
||||||
&:hover {
|
|
||||||
svg {
|
|
||||||
fill: #777;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
a {
|
a {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
@@ -303,6 +298,6 @@
|
|||||||
svg {
|
svg {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
fill: #aaa;
|
fill: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,12 +95,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-btn {
|
|
||||||
position: absolute;
|
|
||||||
right: 10px;
|
|
||||||
top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge-notify {
|
.badge-notify {
|
||||||
background:red;
|
background:red;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ body.ios {
|
|||||||
}
|
}
|
||||||
.post-body {
|
.post-body {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 5;
|
z-index: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
width: 600px;
|
width: 600px;
|
||||||
float: left;
|
float: left;
|
||||||
@@ -439,7 +439,7 @@ body.ios {
|
|||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
&.post-header-post {
|
&.post-header-post {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 5;
|
z-index: 1;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
float: left;
|
float: left;
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
}
|
}
|
||||||
.post-header {
|
.post-header {
|
||||||
&.post-header-post {
|
&.post-header-post {
|
||||||
|
z-index: inherit;
|
||||||
width: auto;
|
width: auto;
|
||||||
float: none;
|
float: none;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -138,6 +139,7 @@
|
|||||||
}
|
}
|
||||||
.post-header {
|
.post-header {
|
||||||
&.post-header-post {
|
&.post-header-post {
|
||||||
|
z-index: inherit;
|
||||||
width: auto;
|
width: auto;
|
||||||
float: none;
|
float: none;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -624,6 +626,12 @@
|
|||||||
&:hover, &:focus {
|
&:hover, &:focus {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
&.has-close {
|
||||||
|
.btn-close {
|
||||||
|
display: block;
|
||||||
|
@include opacity(0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,24 @@
|
|||||||
}
|
}
|
||||||
&.has-close {
|
&.has-close {
|
||||||
padding-right: 30px;
|
padding-right: 30px;
|
||||||
|
&:hover {
|
||||||
|
.btn-close {
|
||||||
|
display: block;
|
||||||
|
@include opacity(0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 15px;
|
||||||
|
top: -1px;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
@include opacity(0);
|
||||||
|
display: none;
|
||||||
|
&:hover {
|
||||||
|
@include opacity(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&.nav-more {
|
&.nav-more {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user