🐛 修复生命周期收起按钮点击响应
This commit is contained in:
@@ -75,7 +75,9 @@ def write_detail_collapse_script(theme_dir: Path) -> bool:
|
|||||||
btn.type = 'button';
|
btn.type = 'button';
|
||||||
btn.className = 'fcbx-life-toggle mt-3 rounded-lg border px-3 py-2 text-sm font-medium transition';
|
btn.className = 'fcbx-life-toggle mt-3 rounded-lg border px-3 py-2 text-sm font-medium transition';
|
||||||
btn.style.cssText = 'border-color:rgba(148,163,184,.55);display:inline-flex;align-items:center;gap:.35rem;';
|
btn.style.cssText = 'border-color:rgba(148,163,184,.55);display:inline-flex;align-items:center;gap:.35rem;';
|
||||||
btn.addEventListener('click', () => {
|
btn.addEventListener('click', event => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
section.dataset.fcbxLifecycleCollapsed = section.dataset.fcbxLifecycleCollapsed === '1' ? '0' : '1';
|
section.dataset.fcbxLifecycleCollapsed = section.dataset.fcbxLifecycleCollapsed === '1' ? '0' : '1';
|
||||||
apply(section);
|
apply(section);
|
||||||
});
|
});
|
||||||
@@ -116,9 +118,8 @@ def main() -> None:
|
|||||||
theme = ASSETS_ROOT / 'themes/2026'
|
theme = ASSETS_ROOT / 'themes/2026'
|
||||||
assets = theme / 'assets'
|
assets = theme / 'assets'
|
||||||
if assets.exists():
|
if assets.exists():
|
||||||
for path in assets.glob('FileManageView-*.js'):
|
# 只用独立 DOM 脚本处理生命周期收起,避免再改编译后的 FileManageView,
|
||||||
if patch_file_manage(path):
|
# 否则 Vue 内部状态和外部补丁会互相抢状态,导致展开/收起需要点多次。
|
||||||
changed.append(str(path.relative_to(ASSETS_ROOT)))
|
|
||||||
for path in assets.glob('clipboard-*.js'):
|
for path in assets.glob('clipboard-*.js'):
|
||||||
if patch_clipboard(path):
|
if patch_clipboard(path):
|
||||||
changed.append(str(path.relative_to(ASSETS_ROOT)))
|
changed.append(str(path.relative_to(ASSETS_ROOT)))
|
||||||
|
|||||||
Reference in New Issue
Block a user