feat(ui): replace native sort select with custom dropdown sized to selected text

This commit is contained in:
Will Miao
2026-06-26 09:53:04 +08:00
parent 3a2941d751
commit d2d109a69c
5 changed files with 452 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import { getStorageItem, setStorageItem, removeStorageItem, getSessionItem, setS
import { showToast, openCivitaiByMetadata } from '../../utils/uiHelpers.js';
import { performModelUpdateCheck } from '../../utils/updateCheckHelpers.js';
import { sidebarManager } from '../SidebarManager.js';
import { initSortDropdown } from './SortDropdown.js';
/**
* PageControls class - Unified control management for model pages
@@ -106,6 +107,7 @@ export class PageControls {
// Sort select handler
const sortSelect = document.getElementById('sortSelect');
if (sortSelect) {
initSortDropdown(sortSelect);
sortSelect.value = this.pageState.sortBy;
sortSelect.addEventListener('change', async (e) => {
this.pageState.sortBy = e.target.value;