Calendar: Fix cdbfcb391 broke planner view

This commit is contained in:
nathangray 2020-03-18 10:15:22 -06:00
parent d21cd6bcd9
commit a2d9e8cae0
2 changed files with 43 additions and 41 deletions

View File

@ -170,12 +170,13 @@ var et2_calendar_event = /** @class */ (function (_super) {
// Copy to avoid changes, which may cause nm problems
var value = event === null ? null : jQuery.extend({}, event);
var parent = this.getParent();
var parent_owner = parent.getDOMNode(parent).dataset['owner'] || parent.getParent().options.owner;
// Make sure id is a string, check values
if (value) {
this._values_check(value);
}
// Check for changing days in the grid view
if (!this._sameday_check(value) || !this._status_check(value, app.calendar.getState().status_filter, parent.options.owner)) {
if (!this._sameday_check(value) || !this._status_check(value, app.calendar.getState().status_filter, parent_owner)) {
// May need to update parent to remove out-of-view events
parent.removeChild(this);
if (event === null && parent && parent.instanceOf(et2_widget_daycol_1.et2_calendar_daycol)) {

View File

@ -209,7 +209,8 @@ export class et2_calendar_event extends et2_valueWidget implements et2_IDetached
{
// Copy to avoid changes, which may cause nm problems
const value = event === null ? null : jQuery.extend({}, event);
let parent = this.getParent();
let parent = <et2_DOMWidget>this.getParent();
let parent_owner = parent.getDOMNode(parent).dataset['owner'] || parent.getParent().options.owner;
// Make sure id is a string, check values
if(value)
@ -218,7 +219,7 @@ export class et2_calendar_event extends et2_valueWidget implements et2_IDetached
}
// Check for changing days in the grid view
if(!this._sameday_check(value) || !this._status_check(value, app.calendar.getState().status_filter, parent.options.owner))
if(!this._sameday_check(value) || !this._status_check(value, app.calendar.getState().status_filter, parent_owner))
{
// May need to update parent to remove out-of-view events
parent.removeChild(this);