mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
give more top padding to gaps that appear in the middle of the timeline
This commit is contained in:
parent
247d6a2148
commit
04edff29cf
@ -22,6 +22,7 @@ export class GapTile extends SimpleTile {
|
||||
super(options);
|
||||
this._loading = false;
|
||||
this._error = null;
|
||||
this._isAtTop = true;
|
||||
}
|
||||
|
||||
async fill() {
|
||||
@ -48,6 +49,21 @@ export class GapTile extends SimpleTile {
|
||||
this.fill();
|
||||
}
|
||||
|
||||
get isAtTop() {
|
||||
return this._isAtTop;
|
||||
}
|
||||
|
||||
updatePreviousSibling(prev) {
|
||||
console.log("GapTile.updatePreviousSibling", prev);
|
||||
super.updatePreviousSibling(prev);
|
||||
const isAtTop = !prev;
|
||||
if (this._isAtTop !== isAtTop) {
|
||||
this._isAtTop = isAtTop;
|
||||
console.log("isAtTop", this._isAtTop);
|
||||
this.emitChange("isAtTop");
|
||||
}
|
||||
}
|
||||
|
||||
updateEntry(entry, params) {
|
||||
super.updateEntry(entry, params);
|
||||
if (!entry.isGap) {
|
||||
|
@ -362,3 +362,11 @@ only loads when the top comes into view*/
|
||||
.GapView > :not(:first-child) {
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.GapView {
|
||||
padding: 52px 20px;
|
||||
}
|
||||
|
||||
.GapView.isAtTop {
|
||||
padding: 52px 20px 12px 20px;
|
||||
}
|
||||
|
@ -61,7 +61,6 @@ limitations under the License.
|
||||
|
||||
.GapView {
|
||||
display: flex;
|
||||
padding: 52px 20px 12px 20px;
|
||||
}
|
||||
|
||||
.GapView > :nth-child(2) {
|
||||
|
@ -21,7 +21,8 @@ export class GapView extends TemplateView {
|
||||
render(t, vm) {
|
||||
const className = {
|
||||
GapView: true,
|
||||
isLoading: vm => vm.isLoading
|
||||
isLoading: vm => vm.isLoading,
|
||||
isAtTop: vm => vm.isAtTop,
|
||||
};
|
||||
return t.li({className}, [
|
||||
spinner(t),
|
||||
|
Loading…
Reference in New Issue
Block a user