mirror of https://github.com/vector-im/riot-web
Discard all mx_fadable legacy cruft which is totally useless
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
edcdd950f7
commit
6b01b6ac6c
|
@ -208,12 +208,6 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* applied to side-panels and messagepanel when in RoomSettings */
|
|
||||||
.mx_fadable {
|
|
||||||
opacity: 1;
|
|
||||||
transition: opacity 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
// These are magic constants which are excluded from tinting, to let themes
|
// These are magic constants which are excluded from tinting, to let themes
|
||||||
// (which only have CSS, unlike skins) tell the app what their non-tinted
|
// (which only have CSS, unlike skins) tell the app what their non-tinted
|
||||||
// colourscheme is by inspecting the stylesheet DOM.
|
// colourscheme is by inspecting the stylesheet DOM.
|
||||||
|
|
|
@ -649,7 +649,6 @@ export default class GroupView extends React.Component {
|
||||||
editing: false,
|
editing: false,
|
||||||
summary: null,
|
summary: null,
|
||||||
});
|
});
|
||||||
dis.dispatch({action: 'panel_disable'});
|
|
||||||
this._initGroupStore(this.props.groupId);
|
this._initGroupStore(this.props.groupId);
|
||||||
|
|
||||||
if (this.state.avatarChanged) {
|
if (this.state.avatarChanged) {
|
||||||
|
@ -870,10 +869,7 @@ export default class GroupView extends React.Component {
|
||||||
{ _t('Add rooms to this community') }
|
{ _t('Add rooms to this community') }
|
||||||
</div>
|
</div>
|
||||||
</AccessibleButton>) : <div />;
|
</AccessibleButton>) : <div />;
|
||||||
const roomDetailListClassName = classnames({
|
|
||||||
"mx_fadable": true,
|
|
||||||
"mx_fadable_faded": this.state.editing,
|
|
||||||
});
|
|
||||||
return <div className="mx_GroupView_rooms">
|
return <div className="mx_GroupView_rooms">
|
||||||
<div className="mx_GroupView_rooms_header">
|
<div className="mx_GroupView_rooms_header">
|
||||||
<h3>
|
<h3>
|
||||||
|
@ -884,9 +880,7 @@ export default class GroupView extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
{ this.state.groupRoomsLoading ?
|
{ this.state.groupRoomsLoading ?
|
||||||
<Spinner /> :
|
<Spinner /> :
|
||||||
<RoomDetailList
|
<RoomDetailList rooms={this.state.groupRooms} />
|
||||||
rooms={this.state.groupRooms}
|
|
||||||
className={roomDetailListClassName} />
|
|
||||||
}
|
}
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,9 +71,6 @@ interface IProps {
|
||||||
viaServers?: string[];
|
viaServers?: string[];
|
||||||
hideToSRUsers: boolean;
|
hideToSRUsers: boolean;
|
||||||
resizeNotifier: ResizeNotifier;
|
resizeNotifier: ResizeNotifier;
|
||||||
middleDisabled: boolean;
|
|
||||||
leftDisabled: boolean;
|
|
||||||
rightDisabled: boolean;
|
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
page_type: string;
|
page_type: string;
|
||||||
autoJoin: boolean;
|
autoJoin: boolean;
|
||||||
|
@ -100,10 +97,6 @@ interface IUsageLimit {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
mouseDown?: {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
};
|
|
||||||
syncErrorData?: {
|
syncErrorData?: {
|
||||||
error: {
|
error: {
|
||||||
data: IUsageLimit;
|
data: IUsageLimit;
|
||||||
|
@ -151,7 +144,6 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
mouseDown: undefined,
|
|
||||||
syncErrorData: undefined,
|
syncErrorData: undefined,
|
||||||
// use compact timeline view
|
// use compact timeline view
|
||||||
useCompactLayout: SettingsStore.getValue('useCompactLayout'),
|
useCompactLayout: SettingsStore.getValue('useCompactLayout'),
|
||||||
|
@ -549,48 +541,6 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
), true);
|
), true);
|
||||||
};
|
};
|
||||||
|
|
||||||
_onMouseDown = (ev) => {
|
|
||||||
// When the panels are disabled, clicking on them results in a mouse event
|
|
||||||
// which bubbles to certain elements in the tree. When this happens, close
|
|
||||||
// any settings page that is currently open (user/room/group).
|
|
||||||
if (this.props.leftDisabled && this.props.rightDisabled) {
|
|
||||||
const targetClasses = new Set(ev.target.className.split(' '));
|
|
||||||
if (
|
|
||||||
targetClasses.has('mx_MatrixChat') ||
|
|
||||||
targetClasses.has('mx_MatrixChat_middlePanel') ||
|
|
||||||
targetClasses.has('mx_RoomView')
|
|
||||||
) {
|
|
||||||
this.setState({
|
|
||||||
mouseDown: {
|
|
||||||
x: ev.pageX,
|
|
||||||
y: ev.pageY,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
_onMouseUp = (ev) => {
|
|
||||||
if (!this.state.mouseDown) return;
|
|
||||||
|
|
||||||
const deltaX = ev.pageX - this.state.mouseDown.x;
|
|
||||||
const deltaY = ev.pageY - this.state.mouseDown.y;
|
|
||||||
const distance = Math.sqrt((deltaX * deltaX) + (deltaY + deltaY));
|
|
||||||
const maxRadius = 5; // People shouldn't be straying too far, hopefully
|
|
||||||
|
|
||||||
// Note: we track how far the user moved their mouse to help
|
|
||||||
// combat against https://github.com/vector-im/element-web/issues/7158
|
|
||||||
|
|
||||||
if (distance < maxRadius) {
|
|
||||||
// This is probably a real click, and not a drag
|
|
||||||
dis.dispatch({ action: 'close_settings' });
|
|
||||||
}
|
|
||||||
|
|
||||||
// Always clear the mouseDown state to ensure we don't accidentally
|
|
||||||
// use stale values due to the mouseDown checks.
|
|
||||||
this.setState({mouseDown: null});
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const RoomView = sdk.getComponent('structures.RoomView');
|
const RoomView = sdk.getComponent('structures.RoomView');
|
||||||
const UserView = sdk.getComponent('structures.UserView');
|
const UserView = sdk.getComponent('structures.UserView');
|
||||||
|
@ -610,7 +560,6 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
oobData={this.props.roomOobData}
|
oobData={this.props.roomOobData}
|
||||||
viaServers={this.props.viaServers}
|
viaServers={this.props.viaServers}
|
||||||
key={this.props.currentRoomId || 'roomview'}
|
key={this.props.currentRoomId || 'roomview'}
|
||||||
disabled={this.props.middleDisabled}
|
|
||||||
resizeNotifier={this.props.resizeNotifier}
|
resizeNotifier={this.props.resizeNotifier}
|
||||||
/>;
|
/>;
|
||||||
break;
|
break;
|
||||||
|
@ -658,8 +607,6 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
onKeyDown={this._onReactKeyDown}
|
onKeyDown={this._onReactKeyDown}
|
||||||
className='mx_MatrixChat_wrapper'
|
className='mx_MatrixChat_wrapper'
|
||||||
aria-hidden={this.props.hideToSRUsers}
|
aria-hidden={this.props.hideToSRUsers}
|
||||||
onMouseDown={this._onMouseDown}
|
|
||||||
onMouseUp={this._onMouseUp}
|
|
||||||
>
|
>
|
||||||
<ToastContainer />
|
<ToastContainer />
|
||||||
<DragDropContext onDragEnd={this._onDragEnd}>
|
<DragDropContext onDragEnd={this._onDragEnd}>
|
||||||
|
|
|
@ -181,9 +181,6 @@ interface IState {
|
||||||
currentUserId?: string;
|
currentUserId?: string;
|
||||||
// this is persisted as mx_lhs_size, loaded in LoggedInView
|
// this is persisted as mx_lhs_size, loaded in LoggedInView
|
||||||
collapseLhs: boolean;
|
collapseLhs: boolean;
|
||||||
leftDisabled: boolean;
|
|
||||||
middleDisabled: boolean;
|
|
||||||
// the right panel's disabled state is tracked in its store.
|
|
||||||
// Parameters used in the registration dance with the IS
|
// Parameters used in the registration dance with the IS
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
register_client_secret?: string;
|
register_client_secret?: string;
|
||||||
|
@ -236,8 +233,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
this.state = {
|
this.state = {
|
||||||
view: Views.LOADING,
|
view: Views.LOADING,
|
||||||
collapseLhs: false,
|
collapseLhs: false,
|
||||||
leftDisabled: false,
|
|
||||||
middleDisabled: false,
|
|
||||||
|
|
||||||
hideToSRUsers: false,
|
hideToSRUsers: false,
|
||||||
|
|
||||||
|
@ -710,14 +705,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
this.state.resizeNotifier.notifyLeftHandleResized();
|
this.state.resizeNotifier.notifyLeftHandleResized();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'panel_disable': {
|
|
||||||
this.setState({
|
|
||||||
leftDisabled: payload.leftDisabled || payload.sideDisabled || false,
|
|
||||||
middleDisabled: payload.middleDisabled || false,
|
|
||||||
// We don't track the right panel being disabled here - it's tracked in the store.
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'on_logged_in':
|
case 'on_logged_in':
|
||||||
if (
|
if (
|
||||||
!Lifecycle.isSoftLogout() &&
|
!Lifecycle.isSoftLogout() &&
|
||||||
|
|
|
@ -304,14 +304,8 @@ export default class RightPanel extends React.Component {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const classes = classNames("mx_RightPanel", "mx_fadable", {
|
|
||||||
"collapsed": this.props.collapsed,
|
|
||||||
"mx_fadable_faded": this.props.disabled,
|
|
||||||
"dark-panel": true,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<aside className={classes} id="mx_RightPanel">
|
<aside className="mx_RightPanel dark-panel" id="mx_RightPanel">
|
||||||
{ panel }
|
{ panel }
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
|
|
|
@ -105,7 +105,6 @@ interface IProps {
|
||||||
viaServers?: string[];
|
viaServers?: string[];
|
||||||
|
|
||||||
autoJoin?: boolean;
|
autoJoin?: boolean;
|
||||||
disabled?: boolean;
|
|
||||||
resizeNotifier: ResizeNotifier;
|
resizeNotifier: ResizeNotifier;
|
||||||
|
|
||||||
// Called with the credentials of a registered user (if they were a ROU that transitioned to PWLU)
|
// Called with the credentials of a registered user (if they were a ROU that transitioned to PWLU)
|
||||||
|
@ -1871,7 +1870,6 @@ export default class RoomView extends React.Component<IProps, IState> {
|
||||||
<MessageComposer
|
<MessageComposer
|
||||||
room={this.state.room}
|
room={this.state.room}
|
||||||
callState={this.state.callState}
|
callState={this.state.callState}
|
||||||
disabled={this.props.disabled}
|
|
||||||
showApps={this.state.showApps}
|
showApps={this.state.showApps}
|
||||||
e2eStatus={this.state.e2eStatus}
|
e2eStatus={this.state.e2eStatus}
|
||||||
resizeNotifier={this.props.resizeNotifier}
|
resizeNotifier={this.props.resizeNotifier}
|
||||||
|
@ -2027,10 +2025,6 @@ export default class RoomView extends React.Component<IProps, IState> {
|
||||||
"mx_RoomView_statusArea_expanded": isStatusAreaExpanded,
|
"mx_RoomView_statusArea_expanded": isStatusAreaExpanded,
|
||||||
});
|
});
|
||||||
|
|
||||||
const fadableSectionClasses = classNames("mx_RoomView_body", "mx_fadable", {
|
|
||||||
"mx_fadable_faded": this.props.disabled,
|
|
||||||
});
|
|
||||||
|
|
||||||
const showRightPanel = this.state.room && this.state.showRightPanel;
|
const showRightPanel = this.state.room && this.state.showRightPanel;
|
||||||
const rightPanel = showRightPanel
|
const rightPanel = showRightPanel
|
||||||
? <RightPanel room={this.state.room} resizeNotifier={this.props.resizeNotifier} />
|
? <RightPanel room={this.state.room} resizeNotifier={this.props.resizeNotifier} />
|
||||||
|
@ -2062,7 +2056,7 @@ export default class RoomView extends React.Component<IProps, IState> {
|
||||||
e2eStatus={this.state.e2eStatus}
|
e2eStatus={this.state.e2eStatus}
|
||||||
/>
|
/>
|
||||||
<MainSplit panel={rightPanel} resizeNotifier={this.props.resizeNotifier}>
|
<MainSplit panel={rightPanel} resizeNotifier={this.props.resizeNotifier}>
|
||||||
<div className={fadableSectionClasses}>
|
<div className="mx_RoomView_body">
|
||||||
{auxPanel}
|
{auxPanel}
|
||||||
<div className={timelineClasses}>
|
<div className={timelineClasses}>
|
||||||
{topUnreadMessagesBar}
|
{topUnreadMessagesBar}
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import dis from '../../../dispatcher/dispatcher';
|
|
||||||
import {Key} from '../../../Keyboard';
|
import {Key} from '../../../Keyboard';
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,19 +27,10 @@ export default class ForwardMessage extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
dis.dispatch({
|
|
||||||
action: 'panel_disable',
|
|
||||||
middleDisabled: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
document.addEventListener('keydown', this._onKeyDown);
|
document.addEventListener('keydown', this._onKeyDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
dis.dispatch({
|
|
||||||
action: 'panel_disable',
|
|
||||||
middleDisabled: false,
|
|
||||||
});
|
|
||||||
document.removeEventListener('keydown', this._onKeyDown);
|
document.removeEventListener('keydown', this._onKeyDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue