mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-20 21:41:32 +01:00
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:
parent
240048f833
commit
327a5a4bda
@ -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;
|
||||
|
@ -5346,6 +5346,11 @@ body:not(.movingUI) .drawer-content.maximized {
|
||||
color: #FAF8F6;
|
||||
}
|
||||
|
||||
.popup.vertical_scrolling_dialogue_popup:has(.faPicker) {
|
||||
/* Fix height for fa picker popup, otherwise search is making it resize weirdly */
|
||||
height: 70%;
|
||||
}
|
||||
|
||||
.faPicker {
|
||||
display: flex;
|
||||
gap: 1em;
|
||||
@ -5365,3 +5370,9 @@ body:not(.movingUI) .drawer-content.maximized {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.faPicker:not(:has(:not(.hidden)))::after {
|
||||
content: 'No icons found';
|
||||
color: var(--SmartThemeBodyColor);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user