Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CSS to stop greyed Right/LeftPanel UI from being interactable #5422

Merged
merged 3 commits into from
Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/components/structures/LeftPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
import React from 'react';
import { DragDropContext } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
import classNames from 'classnames';
import KeyCode from 'matrix-react-sdk/lib/KeyCode';
import sdk from 'matrix-react-sdk';
import dis from 'matrix-react-sdk/lib/dispatcher';
Expand Down Expand Up @@ -55,7 +56,7 @@ var LeftPanel = React.createClass({
// We just need to update if any of these things change.
if (
this.props.collapsed !== nextProps.collapsed ||
this.props.opacity !== nextProps.opacity
this.props.disabled !== nextProps.disabled
) {
return true;
}
Expand Down Expand Up @@ -176,14 +177,16 @@ var LeftPanel = React.createClass({
topBox = <SearchBox collapsed={ this.props.collapsed } onSearch={ this.onSearch } />;
}

let classes = "mx_LeftPanel mx_fadable";
if (this.props.collapsed) {
classes += " collapsed";
}
let classes = classNames(
"mx_LeftPanel", "mx_fadable",
{
"collapsed": this.props.collapsed,
"mx_fadable_faded": this.props.disabled,
}
);

return (
<aside className={classes} style={{ opacity: this.props.opacity }}
onKeyDown={ this._onKeyDown } onFocus={ this._onFocus } onBlur={ this._onBlur }>
<aside className={classes} onKeyDown={ this._onKeyDown } onFocus={ this._onFocus } onBlur={ this._onBlur }>
{ topBox }
<CallPreview ConferenceHandler={VectorConferenceHandler} />
<RoomList
Expand Down
14 changes: 9 additions & 5 deletions src/components/structures/RightPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { _t } from 'matrix-react-sdk/lib/languageHandler';
import sdk from 'matrix-react-sdk';
import dis from 'matrix-react-sdk/lib/dispatcher';
Expand Down Expand Up @@ -345,13 +346,16 @@ module.exports = React.createClass({
);
}

let classes = "mx_RightPanel mx_fadable";
if (this.props.collapsed) {
classes += " collapsed";
}
let classes = classNames(
"mx_RightPanel", "mx_fadable",
{
"collapsed": this.props.collapsed,
"mx_fadable_faded": this.props.disabled,
}
);

return (
<aside className={classes} style={{ opacity: this.props.opacity }}>
<aside className={classes}>
<div className="mx_RightPanel_header">
<div className="mx_RightPanel_headerButtonGroup">
{headerButtons}
Expand Down
12 changes: 6 additions & 6 deletions src/components/structures/RoomDirectory.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ module.exports = React.createClass({
});

// dis.dispatch({
// action: 'ui_opacity',
// sideOpacity: 0.3,
// middleOpacity: 0.3,
// action: 'panel_disable',
// sideDisabled: true,
// middleDisabled: true,
// });
},

componentWillUnmount: function() {
// dis.dispatch({
// action: 'ui_opacity',
// sideOpacity: 1.0,
// middleOpacity: 1.0,
// action: 'panel_disable',
// sideDisabled: false,
// middleDisabled: false,
// });
if (this.filterTimeout) {
clearTimeout(this.filterTimeout);
Expand Down
5 changes: 5 additions & 0 deletions src/skins/vector/css/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ textarea {
transition: opacity 0.2s ease-in-out;
}

.mx_fadable.mx_fadable_faded {
opacity: 0.3;
pointer-events: none;
}

/* XXX: critical hack to GeminiScrollbar to allow them to work in FF 42 and Chrome 48.
Stop the scrollbar view from pushing out the container's overall sizing, which causes
flexbox to adapt to the new size and cause the view to keep growing.
Expand Down
41 changes: 20 additions & 21 deletions src/skins/vector/css/matrix-react-sdk/structures/_RoomView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,32 @@ limitations under the License.
max-width: 1920px ! important;
}

.mx_RoomView_topUnreadMessagesBar {

.mx_RoomView_body {
order: 3;
flex: 1 1 0;
flex-direction: column;
display: flex;
}

.mx_RoomView_messagePanel {
order: 4;
.mx_RoomView_body .mx_RoomView_topUnreadMessagesBar {
order: 1;
}

flex: 1 1 0;
.mx_RoomView_body .mx_RoomView_messagePanel {
order: 2;
}

width: 100%;
.mx_RoomView_body .mx_RoomView_statusArea {
order: 3;
}

.mx_RoomView_body .mx_MessageComposer {
order: 4;
}

.mx_RoomView_messagePanel {
width: 100%;
overflow-y: auto;
}

Expand Down Expand Up @@ -131,18 +146,6 @@ limitations under the License.
clear: both;
}

.mx_RoomView_invitePrompt {
order: 2;

min-width: 0px;
max-width: 960px;
width: 100%;
margin: auto;

margin-top: 12px;
margin-bottom: 12px;
}

li.mx_RoomView_myReadMarker_container {
height: 0px;
margin: 0px;
Expand All @@ -160,8 +163,6 @@ hr.mx_RoomView_myReadMarker {
}

.mx_RoomView_statusArea {
order: 5;

width: 100%;
flex: 0 0 auto;

Expand Down Expand Up @@ -236,8 +237,6 @@ hr.mx_RoomView_myReadMarker {
}

.mx_RoomView .mx_MessageComposer {
order: 6;

width: 100%;
flex: 0 0 auto;
margin-right: 2px;
Expand Down