mirror of https://github.com/vector-im/riot-web
Simplify simulated unfill
parent
5737994957
commit
47f29b9454
|
@ -344,17 +344,17 @@ module.exports = React.createClass({
|
||||||
// pagination.
|
// pagination.
|
||||||
//
|
//
|
||||||
// If backwards is true, we unpaginate (remove) tiles from the back (top).
|
// If backwards is true, we unpaginate (remove) tiles from the back (top).
|
||||||
let i = backwards ? 0 : tiles.length - 1;
|
for (let i = 0; i < tiles.length; i++) {
|
||||||
while (
|
const tile = tiles[backwards ? tiles.length - 1 - i : i];
|
||||||
(backwards ? i < tiles.length : i > 0) && excessHeight > tiles[i].clientHeight
|
|
||||||
) {
|
|
||||||
// Subtract height of tile as if it were unpaginated
|
// Subtract height of tile as if it were unpaginated
|
||||||
excessHeight -= tiles[i].clientHeight;
|
excessHeight -= tile.clientHeight;
|
||||||
// The tile may not have a scroll token, so guard it
|
// The tile may not have a scroll token, so guard it
|
||||||
if (tiles[i].dataset.scrollToken) {
|
if (tile.dataset.scrollToken) {
|
||||||
markerScrollToken = tiles[i].dataset.scrollToken;
|
markerScrollToken = tile.dataset.scrollToken;
|
||||||
|
}
|
||||||
|
if (tile.clientHeight > excessHeight) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
i += backwards ? 1 : -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (markerScrollToken) {
|
if (markerScrollToken) {
|
||||||
|
|
Loading…
Reference in New Issue