diff --git a/entity/DocumentTemplate_entity/entityfields/content/stateProcess.js b/entity/DocumentTemplate_entity/entityfields/content/stateProcess.js index bfa1132cc428b632c5cc7b214fc54284ecd4ec6e..635b6ea244723fb9d8122346ceff34075a45f457 100644 --- a/entity/DocumentTemplate_entity/entityfields/content/stateProcess.js +++ b/entity/DocumentTemplate_entity/entityfields/content/stateProcess.js @@ -5,10 +5,14 @@ import("system.neon"); if (vars.get("$field.Content") || !vars.get("$field.BINDATA")) { - // Workaround: prevent removing images via html-editor -> use only preview-field if it's html var type = DocumentTemplateUtils.getContentType(vars.get("$field.DOCUMENTTEMPLATEID"), new FileUpload(vars.get("$field.BINDATA"))) - if (type == DocumentTemplate.types.HTML && !(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.BINDATA"))) + if ((type != DocumentTemplate.types.TXT || + // Workaround: prevent removing images via html-editor -> use only the preview-field if it's html and not the content field + // That's why type HTML -> invisible + type == DocumentTemplate.types.HTML) && !(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$field.BINDATA"))) + { result.string(neon.COMPONENTSTATE_INVISIBLE); + } else result.string(neon.COMPONENTSTATE_EDITABLE); }