Fix forward menu's height calculation.

This commit is contained in:
aforge
2021-10-02 17:07:39 -07:00
parent b8d1cd6f70
commit ab5f2179ea
7 changed files with 10 additions and 10 deletions
+1
View File
@@ -2540,4 +2540,5 @@ ul.tabbar li.active > a {
padding-bottom: 0.35rem; padding-bottom: 0.35rem;
box-shadow: 0 1px 6px rgba(0, 0, 0, .45); box-shadow: 0 1px 6px rgba(0, 0, 0, .45);
background-color: white; background-color: white;
overflow: auto;
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -70,7 +70,8 @@ export default class ForwardMenu extends React.Component {
contacts = contacts.filter((c) => { return c.acs.isJoiner() && c.acs.isWriter(); }); contacts = contacts.filter((c) => { return c.acs.isJoiner() && c.acs.isWriter(); });
// Ensure that menu is inside the app-container. // Ensure that menu is inside the app-container.
const hSize = 20 * REM_SIZE; const hSize = 20 * REM_SIZE;
const vSize = REM_SIZE * (0.7 + contacts.length * 3); // Total vertical size is rougly 4rem x (#contacts + 1 search box).
const vSize = REM_SIZE * 4 * (1 + contacts.length);
const left = (this.props.bounds.right - this.props.clickAt.x < hSize) ? const left = (this.props.bounds.right - this.props.clickAt.x < hSize) ?
(this.props.clickAt.x - this.props.bounds.left - hSize) : (this.props.clickAt.x - this.props.bounds.left - hSize) :
(this.props.clickAt.x - this.props.bounds.left); (this.props.clickAt.x - this.props.bounds.left);
@@ -81,8 +82,7 @@ export default class ForwardMenu extends React.Component {
const style = { const style = {
left: left + 'px', left: left + 'px',
top: top + 'px', top: top + 'px',
maxWidth: hSize + 'px', maxWidth: hSize + 'px'
height: '100%'
}; };
return ( return (
+2 -3
View File
@@ -9770,14 +9770,13 @@ class ForwardMenu extends (react__WEBPACK_IMPORTED_MODULE_0___default().Componen
return c.acs.isJoiner() && c.acs.isWriter(); return c.acs.isJoiner() && c.acs.isWriter();
}); });
const hSize = 20 * _config_js__WEBPACK_IMPORTED_MODULE_5__.REM_SIZE; const hSize = 20 * _config_js__WEBPACK_IMPORTED_MODULE_5__.REM_SIZE;
const vSize = _config_js__WEBPACK_IMPORTED_MODULE_5__.REM_SIZE * (0.7 + contacts.length * 3); const vSize = _config_js__WEBPACK_IMPORTED_MODULE_5__.REM_SIZE * 4 * (1 + contacts.length);
const left = this.props.bounds.right - this.props.clickAt.x < hSize ? this.props.clickAt.x - this.props.bounds.left - hSize : this.props.clickAt.x - this.props.bounds.left; const left = this.props.bounds.right - this.props.clickAt.x < hSize ? this.props.clickAt.x - this.props.bounds.left - hSize : this.props.clickAt.x - this.props.bounds.left;
const top = this.props.bounds.bottom - this.props.clickAt.y < vSize ? Math.max(this.props.clickAt.y - this.props.bounds.top - vSize, this.props.bounds.top + 70) : this.props.clickAt.y - this.props.bounds.top; const top = this.props.bounds.bottom - this.props.clickAt.y < vSize ? Math.max(this.props.clickAt.y - this.props.bounds.top - vSize, this.props.bounds.top + 70) : this.props.clickAt.y - this.props.bounds.top;
const style = { const style = {
left: left + 'px', left: left + 'px',
top: top + 'px', top: top + 'px',
maxWidth: hSize + 'px', maxWidth: hSize + 'px'
height: '100%'
}; };
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "forward-menu", className: "forward-menu",
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long