From 84ecefabf943b1e2e6faba40b3137f290ccc61b2 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Sun, 6 Aug 2023 04:02:10 +0200 Subject: [PATCH] Add option for lazy loading image (#19353) Co-authored-by: Pascal Jufer Co-authored-by: Rijk van Zanten Co-authored-by: ian --- .changeset/clever-goats-relate.md | 5 +++++ .../input-rich-text-html/input-rich-text-html.vue | 4 ++++ app/src/interfaces/input-rich-text-html/useImage.ts | 6 +++++- app/src/lang/translations/en-US.yaml | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changeset/clever-goats-relate.md diff --git a/.changeset/clever-goats-relate.md b/.changeset/clever-goats-relate.md new file mode 100644 index 0000000000..7d674e2855 --- /dev/null +++ b/.changeset/clever-goats-relate.md @@ -0,0 +1,5 @@ +--- +"@directus/app": patch +--- + +Introduced option to control lazy loading attribute for images in WYSIWYG interface diff --git a/app/src/interfaces/input-rich-text-html/input-rich-text-html.vue b/app/src/interfaces/input-rich-text-html/input-rich-text-html.vue index a463780b40..188c1f3e31 100644 --- a/app/src/interfaces/input-rich-text-html/input-rich-text-html.vue +++ b/app/src/interfaces/input-rich-text-html/input-rich-text-html.vue @@ -96,6 +96,10 @@ +
+
{{ t('wysiwyg_options.lazy_loading') }}
+ +
{{ t('transformation_preset_key') }}
`; + const imageHtml = `${img.alt}`; editor.value.selection.setContent(imageHtml); editor.value.undoManager.add(); closeImageDrawer(); diff --git a/app/src/lang/translations/en-US.yaml b/app/src/lang/translations/en-US.yaml index 2aa294c88c..7a3f3a4496 100644 --- a/app/src/lang/translations/en-US.yaml +++ b/app/src/lang/translations/en-US.yaml @@ -961,6 +961,8 @@ wysiwyg_options: source_code: Edit Source Code fullscreen: Full Screen directionality: Directionality + lazy_loading: Lazy Load Image + lazy_loading_label: Enable Lazy Loading dropdown: Dropdown choices: Choices choices_option_configured_incorrectly: Choices configured incorrectly