Calendar: Fix events that were updated while calendar was not the active tab were misplaced at the beginning of the day

This commit is contained in:
nathangray 2021-02-10 13:10:28 -07:00
parent f67f0aa28c
commit c42795cc9e
2 changed files with 18 additions and 0 deletions

View File

@ -308,6 +308,14 @@ var et2_calendar_daycol = /** @class */ (function (_super) {
event_ids.splice(i--, 1);
}
}
if (!this.div.is(":visible")) {
// Not visible, defer the layout or it all winds up at the top
// Cancel any existing listener & bind
jQuery(this.getInstanceManager().DOMContainer.parentNode)
.off('show.et2_daycol' + this.id)
.one('show.et2_daycol' + this.id, function () { this._update_events(events); }.bind(this));
return;
}
if (!this.getParent().disabled)
this._update_events(events);
};

View File

@ -404,6 +404,16 @@ export class et2_calendar_daycol extends et2_valueWidget implements et2_IDetache
event_ids.splice(i--,1);
}
}
if(!this.div.is(":visible"))
{
// Not visible, defer the layout or it all winds up at the top
// Cancel any existing listener & bind
jQuery(this.getInstanceManager().DOMContainer.parentNode)
.off('show.et2_daycol'+this.id)
.one('show.et2_daycol'+this.id, function() {this._update_events(events)}.bind(this));
return;
}
if(!this.getParent().disabled)
this._update_events(events);
}