From 79f7afaeeceffdefa6f01db1ff7095ce65188a1b Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 4 Jun 2025 16:43:08 +0530 Subject: [PATCH] feat: allow disabling editor --- app/javascript/ui/LiteReplyBox.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/javascript/ui/LiteReplyBox.vue b/app/javascript/ui/LiteReplyBox.vue index a7ce5f90eac..4ce8358fa2e 100644 --- a/app/javascript/ui/LiteReplyBox.vue +++ b/app/javascript/ui/LiteReplyBox.vue @@ -107,9 +107,13 @@ export default { maxLength() { return MESSAGE_MAX_LENGTH.GENERAL; }, + isEditorDisabled() { + // eslint-disable-next-line no-underscore-dangle + return window.__DISABLE_EDITOR__; + }, allowFileUpload() { // eslint-disable-next-line no-underscore-dangle - return window.__EDITOR_DISABLE_UPLOAD__ !== true; + return window.__EDITOR_DISABLE_UPLOAD__ === true; }, replyButtonLabel() { if (this.isPrivate) { @@ -121,6 +125,7 @@ export default { return { 'is-private': this.isPrivate, 'is-focused': this.isFocused || this.hasAttachments, + 'pointer-events-none grayscale opacity-70': this.isEditorDisabled, }; }, hasAttachments() { @@ -380,6 +385,7 @@ export default {