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