FA picker popup improvements

- Fixed height (to prevent bouncing and lag/performance issues due to constant resizing. Also looks nicer)
- Added "No icons found" empty text
- Slight rework of button callback
This commit is contained in:
Wolfsblvt
2024-07-17 20:47:42 +02:00
parent 240048f833
commit 327a5a4bda
2 changed files with 14 additions and 6 deletions

View File

@ -1938,7 +1938,7 @@ export async function showFontAwesomePicker(customList = null) {
}
}
});
qry.addEventListener('input', qryDebounced);
qry.addEventListener('input', () => qryDebounced());
search.append(qry);
}
dom.append(search);
@ -1953,10 +1953,7 @@ export async function showFontAwesomePicker(customList = null) {
opt.classList.add(fa);
opt.title = fa.slice(3);
opt.dataset.result = POPUP_RESULT.AFFIRMATIVE.toString();
opt.addEventListener('click', ()=>{
value = fa;
picker.completeAffirmative();
});
opt.addEventListener('click', () => value = fa);
grid.append(opt);
}
}
@ -1964,7 +1961,7 @@ export async function showFontAwesomePicker(customList = null) {
}
}
let value = '';
const picker = new Popup(dom, POPUP_TYPE.CONFIRM, null, { allowVerticalScrolling:true, okButton: 'No Icon', cancelButton: 'Cancel' });
const picker = new Popup(dom, POPUP_TYPE.TEXT, null, { allowVerticalScrolling: true, okButton: 'No Icon', cancelButton: 'Cancel' });
await picker.show();
if (picker.result == POPUP_RESULT.AFFIRMATIVE) {
return value;