mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-01 11:56:48 +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);
|
search.append(qry);
|
||||||
}
|
}
|
||||||
dom.append(search);
|
dom.append(search);
|
||||||
@ -1953,10 +1953,7 @@ export async function showFontAwesomePicker(customList = null) {
|
|||||||
opt.classList.add(fa);
|
opt.classList.add(fa);
|
||||||
opt.title = fa.slice(3);
|
opt.title = fa.slice(3);
|
||||||
opt.dataset.result = POPUP_RESULT.AFFIRMATIVE.toString();
|
opt.dataset.result = POPUP_RESULT.AFFIRMATIVE.toString();
|
||||||
opt.addEventListener('click', ()=>{
|
opt.addEventListener('click', () => value = fa);
|
||||||
value = fa;
|
|
||||||
picker.completeAffirmative();
|
|
||||||
});
|
|
||||||
grid.append(opt);
|
grid.append(opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1964,7 +1961,7 @@ export async function showFontAwesomePicker(customList = null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
let value = '';
|
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();
|
await picker.show();
|
||||||
if (picker.result == POPUP_RESULT.AFFIRMATIVE) {
|
if (picker.result == POPUP_RESULT.AFFIRMATIVE) {
|
||||||
return value;
|
return value;
|
||||||
|
@ -5346,6 +5346,11 @@ body:not(.movingUI) .drawer-content.maximized {
|
|||||||
color: #FAF8F6;
|
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 {
|
.faPicker {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1em;
|
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…
x
Reference in New Issue
Block a user