From 26673f87fb497959446f157adb435c47a572785b Mon Sep 17 00:00:00 2001 From: milan Date: Thu, 19 Sep 2024 17:36:27 +0200 Subject: [PATCH] fix type error if widget does not have div or body --- api/js/etemplate/Et2Tree/Et2Tree.ts | 2 +- calendar/js/et2_widget_event.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/js/etemplate/Et2Tree/Et2Tree.ts b/api/js/etemplate/Et2Tree/Et2Tree.ts index edff6576d4..4e4e147912 100644 --- a/api/js/etemplate/Et2Tree/Et2Tree.ts +++ b/api/js/etemplate/Et2Tree/Et2Tree.ts @@ -839,7 +839,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin return; } let id = option.value ?? (typeof option.id == 'number' ? String(option.id) : option.id); - console.log(event.type, id); + //console.log(event.type, id); const typeMap = { dragenter: EGW_AI_DRAG_ENTER, diff --git a/calendar/js/et2_widget_event.ts b/calendar/js/et2_widget_event.ts index 0427fdab7a..907c01309b 100644 --- a/calendar/js/et2_widget_event.ts +++ b/calendar/js/et2_widget_event.ts @@ -177,13 +177,13 @@ export class et2_calendar_event extends et2_valueWidget implements et2_IDetached this._actionObject = null; } - this.div.off(); - this.title.remove(); + this.div?.off(); + this.title?.remove(); this.title = null; - this.body.remove(); + this.body?.remove(); this.body = null; this.icons = null; - this.div.remove(); + this.div?.remove(); this.div = null; jQuery('body.egw_tooltip').remove();