mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-01 16:36:06 +00:00
feat(ui): the owner and VM lists of the ownership forms are searchable
The VM page's Add owner and a user's Add VM page listed every user and every VM in a plain drop-down: with 800 users and 300 VMs one was found by scrolling. They now have a search box (Tom Select, already used by the create form), through searchable_select.js for a select with data-searchable. The box loses focus once an item is chosen: focused, it is a line taller, and on a phone the tap on Save shrank it and moved the button away from under the finger, so the first tap did nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
0368d94f27
commit
aefe551450
8 changed files with 44 additions and 2 deletions
8
static/js/searchable_select.js
Normal file
8
static/js/searchable_select.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// A <select data-searchable> of many users or VMs gets a search box (Tom Select).
|
||||
document.querySelectorAll("select[data-searchable]").forEach(function (select) {
|
||||
new TomSelect(select, {
|
||||
// the box leaves its focused, taller look at once: else the next tap's
|
||||
// button moves away under the finger on a phone
|
||||
onItemAdd: function () { this.blur(); },
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue