From: Anton Khorev Date: Thu, 8 Aug 2024 03:30:35 +0000 (+0300) Subject: Switch away from help tab when help sidebar becomes visible X-Git-Tag: live~251^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a9fa75687896fb4302052a04ed8f7f202a5d6852?hp=8401cd0d140fd9bd0a2b12415745179e90c7e27a Switch away from help tab when help sidebar becomes visible --- 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"); + } }); };