Add folder tag toggle and feedback button; refactor theme toggle

This commit is contained in:
Will Miao
2025-02-05 17:40:39 +08:00
parent e2793a71be
commit 210bc70481
4 changed files with 114 additions and 10 deletions

View File

@@ -96,4 +96,28 @@ export function openCivitai(modelName) {
// 如果没有ID尝试使用名称搜索
window.open(`https://civitai.com/models?query=${encodeURIComponent(modelName)}`, '_blank');
}
}
export function toggleFolderTags() {
const folderTags = document.querySelector('.folder-tags');
if (!folderTags) return;
const isHidden = folderTags.style.display === 'none';
folderTags.style.display = isHidden ? 'flex' : 'none';
// Save preference
localStorage.setItem('folderTagsVisible', isHidden ? 'true' : 'false');
}
export function openFeedback() {
window.open('https://github.com/willmiao/ComfyUI-Lora-Manager/issues/new', '_blank');
}
// Add this to your existing initialization code
export function initFolderTagsVisibility() {
const folderTags = document.querySelector('.folder-tags');
if (!folderTags) return;
const isVisible = localStorage.getItem('folderTagsVisible') !== 'false';
folderTags.style.display = isVisible ? 'flex' : 'none';
}