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);
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) {

View file

@ -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;
}

View file

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

View file

@ -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),