From c5e637fef28a202beb1682ee35071ed9c5e13804 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Tue, 16 Jun 2026 09:53:30 +0000 Subject: [PATCH] fix: keep subtab bar above content when subtab panes precede parent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The subtab bar lives inside the parent tab pane. When the doctype's field_order places the subtab content panes BEFORE the parent pane (e.g. E-Taxes Settings "Data": customers_tab/suppliers_tab come before data_tab), the activated content renders above the bar and pushes it off-screen — looking like the subtabs vanished. Parents whose children come after them (e.g. "Mappings") were unaffected. On subtab click, move the active content pane to sit right after the parent pane so the bar always renders above it. Co-Authored-By: Claude Opus 4.8 (1M context) --- custom_subtabs/public/js/custom_subtabs.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom_subtabs/public/js/custom_subtabs.js b/custom_subtabs/public/js/custom_subtabs.js index f810cf5..0157bdd 100644 --- a/custom_subtabs/public/js/custom_subtabs.js +++ b/custom_subtabs/public/js/custom_subtabs.js @@ -178,6 +178,14 @@ function setup_custom_subtabs(wrapper, currentDoctype) { const parentPane = $(`#${parentContainerId}`); if (parentPane.length) { parentPane.addClass("active show").css("display", "block"); + + // Панель-контент субтаба может стоять в DOM РАНЬШЕ родительской панели + // (зависит от field_order доктайпа). Тогда бар субтабов визуально уезжает ВНИЗ + // под контент и кажется, что субтабы пропали. Ставим активный контент сразу + // после родительской панели — бар всегда оказывается над ним. + if (targetPane.length) { + parentPane.after(targetPane); + } } // Show parent chain (для вложенности глубже одного уровня)