From 36630535046f2ae9026af14327bf1c8fc2ea2069 Mon Sep 17 00:00:00 2001 From: "a.klapper" Date: Wed, 30 Jun 2021 11:32:36 +0200 Subject: [PATCH] Added not null check for editables when setting readOnly --- src/assets/editors/ckeditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/editors/ckeditor.js b/src/assets/editors/ckeditor.js index 9b8c672..70183f6 100644 --- a/src/assets/editors/ckeditor.js +++ b/src/assets/editors/ckeditor.js @@ -141,7 +141,7 @@ class CKEditorEditor extends StringEditor { enable () { if(!this.always_disabled) { this.input.disabled = false; - if(this.instance) { + if(this.instance && this.instance.editable()) { this.instance.setReadOnly(false); } super.enable(); @@ -151,7 +151,7 @@ class CKEditorEditor extends StringEditor { disable (always_disabled) { if(always_disabled) this.always_disabled = true; this.input.disabled = true; - if(this.instance) { + if(this.instance && this.instance.editable()) { this.instance.setReadOnly(true); } super.disable();