give more top padding to gaps that appear in the middle of the timeline

This commit is contained in:
Bruno Windels 2021-09-15 15:57:31 +02:00
parent 247d6a2148
commit 04edff29cf
4 changed files with 26 additions and 2 deletions

View File

@ -22,6 +22,7 @@ export class GapTile extends SimpleTile {
super(options); super(options);
this._loading = false; this._loading = false;
this._error = null; this._error = null;
this._isAtTop = true;
} }
async fill() { async fill() {
@ -48,6 +49,21 @@ export class GapTile extends SimpleTile {
this.fill(); 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) { updateEntry(entry, params) {
super.updateEntry(entry, params); super.updateEntry(entry, params);
if (!entry.isGap) { if (!entry.isGap) {

View File

@ -362,3 +362,11 @@ only loads when the top comes into view*/
.GapView > :not(:first-child) { .GapView > :not(:first-child) {
margin-left: 12px; margin-left: 12px;
} }
.GapView {
padding: 52px 20px;
}
.GapView.isAtTop {
padding: 52px 20px 12px 20px;
}

View File

@ -61,7 +61,6 @@ limitations under the License.
.GapView { .GapView {
display: flex; display: flex;
padding: 52px 20px 12px 20px;
} }
.GapView > :nth-child(2) { .GapView > :nth-child(2) {

View File

@ -21,7 +21,8 @@ export class GapView extends TemplateView {
render(t, vm) { render(t, vm) {
const className = { const className = {
GapView: true, GapView: true,
isLoading: vm => vm.isLoading isLoading: vm => vm.isLoading,
isAtTop: vm => vm.isAtTop,
}; };
return t.li({className}, [ return t.li({className}, [
spinner(t), spinner(t),