From b84ef08c294677fa0bed1ae4ec3b1894c20fbd2e Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 13 Oct 2021 15:36:33 +0200 Subject: [PATCH] Set node property for inputWidget as it's expected to contain input node --- api/js/etemplate/Et2InputWidget/Et2InputWidget.ts | 7 ++++++- mail/js/app.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts index d3e2e8894d..35e8d30db0 100644 --- a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts +++ b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts @@ -38,6 +38,7 @@ const Et2InputWidgetMixin = (superclass) => { protected value : string | number | Object; protected _oldValue : string | number | Object; + protected node : HTMLElement; /** WebComponent **/ static get styles() @@ -70,7 +71,11 @@ const Et2InputWidgetMixin = (superclass) => super(...args); } - + connectedCallback() + { + super.connectedCallback(); + this.node = this.getInputNode(); + } set_value(new_value) { this.value = new_value; diff --git a/mail/js/app.js b/mail/js/app.js index 53cf03230c..caccfe622e 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -314,7 +314,7 @@ app.classes.mail = AppJS.extend( { textAreaWidget.tinymce.then(()=>{ that.compose_resizeHandler(); - jQuery(textAreaWidget.editor.iframeElement.contentWindow.document).on('dragenter', function(){ + if (textAreaWidget.editor) jQuery(textAreaWidget.editor.iframeElement.contentWindow.document).on('dragenter', function(){ // anything to bind on tinymce iframe }); });