From a9fa75687896fb4302052a04ed8f7f202a5d6852 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 8 Aug 2024 06:30:35 +0300 Subject: [PATCH] Switch away from help tab when help sidebar becomes visible --- app/assets/javascripts/richtext.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/richtext.js b/app/assets/javascripts/richtext.js index 1383a34df..0ff25bc0a 100644 --- a/app/assets/javascripts/richtext.js +++ b/app/assets/javascripts/richtext.js @@ -41,6 +41,9 @@ $(document).ready(function () { $(".richtext_container .richtext_help_sidebar:visible:empty").each(function () { var container = $(this).closest(".richtext_container"); container.find(".tab-pane[id$='_help']").children().appendTo($(this)); + if (container.find("button[data-bs-target$='_help'].active").length) { + container.find("button[data-bs-target$='_edit']").tab("show"); + } }); }; -- 2.39.5