From 4828a68bcd5a7f7041695d61589c904007393fed Mon Sep 17 00:00:00 2001 From: Thelonius Kort Date: Mon, 29 May 2023 13:19:42 +0200 Subject: [PATCH] Fix following links when editing translation --- assets/js/translation-form.js | 2 ++ lib/outlook_web/live/translation_live/form_component.ex | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/translation-form.js b/assets/js/translation-form.js index d755f3a..cba0c86 100644 --- a/assets/js/translation-form.js +++ b/assets/js/translation-form.js @@ -6,6 +6,8 @@ let TranslationFormHook = { this.tunit_editor = this.el.querySelector("#tunit-editor-content") this.save_edit_button = this.el.querySelector("#save-edit-button") this.save_publish_button = this.el.querySelector("#save-publish-button") + let article_preview_links = document.querySelectorAll(".article-preview a") + article_preview_links.forEach(el => el.addEventListener('click', e => e.preventDefault())) }, keyupHandler(e) { var push_event = true diff --git a/lib/outlook_web/live/translation_live/form_component.ex b/lib/outlook_web/live/translation_live/form_component.ex index 1b358ac..e1eeae8 100644 --- a/lib/outlook_web/live/translation_live/form_component.ex +++ b/lib/outlook_web/live/translation_live/form_component.ex @@ -51,7 +51,7 @@ defmodule OutlookWeb.TranslationLive.FormComponent do <.tunit_editor current_tunit={@current_tunit} target={@myself} /> -
+
<.button phx-disable-with="Translating..." phx-click="translate-deepl" phx-target={@myself} data-confirm-not="Are you sure? All previously translated text will be lost.">Translate with Deepl