Remove unused ContextualMenu features
This commit is contained in:
parent
bb97653455
commit
dc9282c539
2 changed files with 1 additions and 32 deletions
|
@ -163,12 +163,6 @@ limitations under the License.
|
||||||
bottom: 1px;
|
bottom: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_ContextualMenu_field {
|
|
||||||
padding: 3px 6px 3px 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx_ContextualMenu_spinner {
|
.mx_ContextualMenu_spinner {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2015, 2016 OpenMarket Ltd
|
Copyright 2015, 2016 OpenMarket Ltd
|
||||||
Copyright 2018 New Vector Ltd
|
Copyright 2018 New Vector Ltd
|
||||||
|
Copyright 2019 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -15,7 +16,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
@ -48,7 +48,6 @@ export default class ContextualMenu extends React.Component {
|
||||||
menuWidth: PropTypes.number,
|
menuWidth: PropTypes.number,
|
||||||
menuHeight: PropTypes.number,
|
menuHeight: PropTypes.number,
|
||||||
chevronOffset: PropTypes.number,
|
chevronOffset: PropTypes.number,
|
||||||
menuColour: PropTypes.string,
|
|
||||||
chevronFace: PropTypes.string, // top, bottom, left, right or none
|
chevronFace: PropTypes.string, // top, bottom, left, right or none
|
||||||
// Function to be called on menu close
|
// Function to be called on menu close
|
||||||
onFinished: PropTypes.func,
|
onFinished: PropTypes.func,
|
||||||
|
@ -157,25 +156,6 @@ export default class ContextualMenu extends React.Component {
|
||||||
chevronOffset.top = Math.max(props.chevronOffset, props.chevronOffset + target - adjusted);
|
chevronOffset.top = Math.max(props.chevronOffset, props.chevronOffset + target - adjusted);
|
||||||
}
|
}
|
||||||
|
|
||||||
// To override the default chevron colour, if it's been set
|
|
||||||
let chevronCSS = "";
|
|
||||||
if (props.menuColour) {
|
|
||||||
chevronCSS = `
|
|
||||||
.mx_ContextualMenu_chevron_left:after {
|
|
||||||
border-right-color: ${props.menuColour};
|
|
||||||
}
|
|
||||||
.mx_ContextualMenu_chevron_right:after {
|
|
||||||
border-left-color: ${props.menuColour};
|
|
||||||
}
|
|
||||||
.mx_ContextualMenu_chevron_top:after {
|
|
||||||
border-left-color: ${props.menuColour};
|
|
||||||
}
|
|
||||||
.mx_ContextualMenu_chevron_bottom:after {
|
|
||||||
border-left-color: ${props.menuColour};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const chevron = hasChevron ?
|
const chevron = hasChevron ?
|
||||||
<div style={chevronOffset} className={"mx_ContextualMenu_chevron_" + chevronFace} /> :
|
<div style={chevronOffset} className={"mx_ContextualMenu_chevron_" + chevronFace} /> :
|
||||||
undefined;
|
undefined;
|
||||||
|
@ -202,10 +182,6 @@ export default class ContextualMenu extends React.Component {
|
||||||
menuStyle.height = props.menuHeight;
|
menuStyle.height = props.menuHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.menuColour) {
|
|
||||||
menuStyle["backgroundColor"] = props.menuColour;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isNaN(Number(props.menuPaddingTop))) {
|
if (!isNaN(Number(props.menuPaddingTop))) {
|
||||||
menuStyle["paddingTop"] = props.menuPaddingTop;
|
menuStyle["paddingTop"] = props.menuPaddingTop;
|
||||||
}
|
}
|
||||||
|
@ -236,7 +212,6 @@ export default class ContextualMenu extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
{ props.hasBackground && <div className="mx_ContextualMenu_background" style={wrapperStyle}
|
{ props.hasBackground && <div className="mx_ContextualMenu_background" style={wrapperStyle}
|
||||||
onClick={props.closeMenu} onContextMenu={this.onContextMenu} /> }
|
onClick={props.closeMenu} onContextMenu={this.onContextMenu} /> }
|
||||||
<style>{ chevronCSS }</style>
|
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue