From 3aa2e834b0d8e3cdc6d6aa6f696563690ad20c2f Mon Sep 17 00:00:00 2001 From: peijunlei Date: Thu, 3 Sep 2026 09:18:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(tabs):=20=E4=BF=AE=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=B8=AD=E5=BF=83tab=E5=88=87=E6=8D=A2=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/dist_static/static/js/download.js | 8 ++++++-- public/themes/website/1/zh/demo/download.html | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/public/themes/dist_static/static/js/download.js b/public/themes/dist_static/static/js/download.js index 032c59e..45b46eb 100644 --- a/public/themes/dist_static/static/js/download.js +++ b/public/themes/dist_static/static/js/download.js @@ -40,16 +40,19 @@ $(function() { if (!tabId) return; const $dropdownItem = $(`.d-tabs__dropdown-item[data-tab="${tabId}"]`).first(); if ($dropdownItem.length) { - $dropdownItem.addClass("is-active").siblings().removeClass("is-active"); + $(".d-tabs__dropdown-item").removeClass("is-active"); + $dropdownItem.addClass("is-active"); const $trigger = $dropdownItem.closest(".d-tabs__group").find("[data-dropdown-trigger]"); $trigger.find("span").text($dropdownItem.text()); activateTab($trigger); return; } + $(".d-tabs__dropdown-item").removeClass("is-active"); const $target = $(`.d-tabs__item[data-tab="${tabId}"]`).first(); if ($target.length) activateTab($target); }; $(".d-tabs__item:not([data-dropdown-trigger])").on("click", function() { + $(".d-tabs__dropdown-item").removeClass("is-active"); activateTab($(this)); closeDropdowns(); }); @@ -65,7 +68,8 @@ $(function() { }); $(".d-tabs__dropdown-item").on("click", function() { const $item = $(this); - $item.addClass("is-active").siblings().removeClass("is-active"); + $(".d-tabs__dropdown-item").removeClass("is-active"); + $item.addClass("is-active"); const $trigger = $item.closest(".d-tabs__group").find("[data-dropdown-trigger]"); $trigger.find("span").text($item.text()); activateTab($trigger); diff --git a/public/themes/website/1/zh/demo/download.html b/public/themes/website/1/zh/demo/download.html index 609a39f..77c6e01 100644 --- a/public/themes/website/1/zh/demo/download.html +++ b/public/themes/website/1/zh/demo/download.html @@ -64,10 +64,18 @@
- + {php} + $download_cid = (string)input('cid', ''); + if ($download_cid === '') { + $download_cid = (string)($current_cate['id'] ?? ''); + } + $download_all_id = (string)($current_cate['id'] ?? ''); + {/php} + {volist name="sub_cates" id="vo"} {php} $count = getCategoryChildrenCount($vo['id']); + $vo_id = (string)($vo['id'] ?? ''); {/php} {if $count > 0}
@@ -77,14 +85,14 @@ - {hcTaglib:subcategory pid="$vo.id" item="child" sort=""} - {/hcTaglib:subcategory}
{else} - + {/if} {/volist}