]> git.openstreetmap.org Git - rails.git/commitdiff
Switch away from help tab when help sidebar becomes visible
authorAnton Khorev <tony29@yandex.ru>
Thu, 8 Aug 2024 03:30:35 +0000 (06:30 +0300)
committerAnton Khorev <tony29@yandex.ru>
Thu, 8 Aug 2024 04:23:49 +0000 (07:23 +0300)
app/assets/javascripts/richtext.js

index 1383a34dff7a4a67d6804cc1e4ae4f70fddab4f9..0ff25bc0a2a5b788020df235928ccb7394266082 100644 (file)
@@ -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");
+      }
     });
   };