Merge branch 'travis/room-list/scrolling-resize' into travis/room-list/css-layout

This commit is contained in:
Travis Ralston 2020-06-05 08:39:19 -06:00
commit b31a8d494b
3 changed files with 6 additions and 11 deletions

View File

@ -15,10 +15,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_RoomList2_resizer {
cursor: ns-resize;
}
.mx_RoomList.mx_RoomList2 {
overflow-y: auto;
}

View File

@ -217,11 +217,11 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
handles = []; // no handles, we're at a minimum
}
// TODO: Remove Math hacks
let nVisible = Math.floor(layout.visibleTiles);
if (localStorage.getItem("mx_rl_mathfn")) {
nVisible = Math[localStorage.getItem("mx_rl_mathfn")](layout.visibleTiles);
}
console.log({nVisible})
const visibleTiles = tiles.slice(0, nVisible);
// If we're hiding rooms, show a 'show more' button to the user. This button
@ -235,15 +235,12 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
// we +1 to account for the room we're about to hide with our 'show more' button
const numMissing = (tiles.length - visibleTiles.length) + 1;
// TODO: Copy TBD
// TODO: CSS TBD
// TODO: Show N more instead of infinity more?
// TODO: Safely use the same height of a tile, not hardcoded hacks
const moreTileHeightPx = `${layout.tileHeight}px`;
// TODO: Make this an actual tile
visibleTiles.splice(visibleTiles.length - 1, 1, (
<div
onClick={this.onShowAllClick}
style={{height: moreTileHeightPx, lineHeight: moreTileHeightPx, backgroundColor: 'transparent', cursor: 'pointer'}}
style={{height: moreTileHeightPx, lineHeight: moreTileHeightPx, cursor: 'pointer'}}
key='showall'
>
{_t("Show %(n)s more", {n: numMissing})}
@ -257,7 +254,6 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
axis="y"
minConstraints={[-1, minTilesPx]}
maxConstraints={[-1, maxTilesPx]}
draggableOpts={{grid: [-1, 1]}}
resizeHandles={handles}
onResize={this.onResize}
className="mx_RoomSublist2_resizeBox"

View File

@ -1134,6 +1134,9 @@
"Securely back up your keys to avoid losing them. <a>Learn more.</a>": "Securely back up your keys to avoid losing them. <a>Learn more.</a>",
"Not now": "Not now",
"Don't ask me again": "Don't ask me again",
"Jump to first unread room.": "Jump to first unread room.",
"Jump to first invite.": "Jump to first invite.",
"Add room": "Add room",
"Show %(n)s more": "Show %(n)s more",
"Options": "Options",
"%(count)s unread messages including mentions.|other": "%(count)s unread messages including mentions.",