[FIX] web_editor: fix codeview toggle

### Steps to reproduce
* Enable Dev mode
* Open an email template
* Open Code View of the template
* Click the green button in the top right corner of the content box

You should be met with a traceback.

opw-3045759

closes odoo/odoo#106408

X-original-commit: 01fb9cab941d9055efbeac738490fe53a91ceccf
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Nshimiyimana Séna
2022-11-24 13:29:00 +01:00
parent a24e3de28c
commit 445d4cd97c
@@ -307,7 +307,7 @@ export class HtmlField extends Component {
*
* @param {JQuery} $codeview
*/
toggleCodeView (el = this.codeViewRef.el) {
toggleCodeView() {
this.state.showCodeView = !this.state.showCodeView;
this.wysiwyg.odooEditor.observerUnactive('toggleCodeView');
@@ -317,7 +317,7 @@ export class HtmlField extends Component {
this.props.update(value);
} else {
this.wysiwyg.odooEditor.observerActive('toggleCodeView');
const $codeview = $(el);
const $codeview = $(this.codeViewRef.el);
const value = $codeview.val();
this.props.update(value);