From: Anton Khorev Date: Thu, 8 Aug 2024 02:56:06 +0000 (+0300) Subject: Remove .richtext_preview css class X-Git-Tag: live~332^2~6 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/8103eb18ab6db85508cc0474fd540b285467a80a Remove .richtext_preview css class --- diff --git a/app/assets/javascripts/richtext.js b/app/assets/javascripts/richtext.js index 5d0f956b3..7447a0ca2 100644 --- a/app/assets/javascripts/richtext.js +++ b/app/assets/javascripts/richtext.js @@ -5,7 +5,7 @@ $(document).ready(function () { * the user next switches to it. */ $(".richtext_container textarea").change(function () { - $(this).parents(".richtext_container").find(".richtext_preview").empty(); + $(this).parents(".richtext_container").find(".tab-pane[id$='_preview']").empty(); }); /* @@ -13,7 +13,7 @@ $(document).ready(function () { */ $(".richtext_container button[data-bs-target$='_preview']").on("show.bs.tab", function () { var editor = $(this).parents(".richtext_container").find("textarea"); - var preview = $(this).parents(".richtext_container").find(".richtext_preview"); + var preview = $(this).parents(".richtext_container").find(".tab-pane[id$='_preview']"); var minHeight = editor.outerHeight() - preview.outerHeight() + preview.height(); if (preview.contents().length === 0) { diff --git a/app/views/shared/_richtext_field.html.erb b/app/views/shared/_richtext_field.html.erb index b8b48f6c7..eb1aa5d30 100644 --- a/app/views/shared/_richtext_field.html.erb +++ b/app/views/shared/_richtext_field.html.erb @@ -12,7 +12,7 @@
<%= builder.text_area(attribute, options.merge(:wrapper => false, "data-preview-url" => preview_url(:type => type))) %>
-
+