Mobile doesn't like select2

This commit is contained in:
Cohee 2023-09-10 14:39:49 +03:00
parent d81c94de0b
commit dc5deaf47c
2 changed files with 14 additions and 7 deletions

View File

@ -8473,6 +8473,7 @@ jQuery(async function () {
'.ui-widget', '.ui-widget',
'.text_pole', '.text_pole',
'#toast-container', '#toast-container',
'.select2-results',
]; ];
for (const id of forbiddenTargets) { for (const id of forbiddenTargets) {
if (clickTarget.closest(id).length > 0) { if (clickTarget.closest(id).length > 0) {

View File

@ -1,4 +1,5 @@
import { api_server_textgenerationwebui, getRequestHeaders, setGenerationParamsFromPreset } from "../script.js"; import { api_server_textgenerationwebui, getRequestHeaders, setGenerationParamsFromPreset } from "../script.js";
import { getDeviceInfo } from "./RossAscends-mods.js";
let models = []; let models = [];
@ -63,11 +64,16 @@ function getMancerModelTemplate(option) {
} }
jQuery(function () { jQuery(function () {
$('#mancer_model').on('change', onMancerModelSelect).select2({ $('#mancer_model').on('change', onMancerModelSelect);
placeholder: 'Select a model',
searchInputPlaceholder: 'Search models...', const deviceInfo = getDeviceInfo();
searchInputCssClass: 'text_pole', if (deviceInfo && deviceInfo.device.type === 'desktop') {
width: '100%', $('#mancer_model').select2({
templateResult: getMancerModelTemplate, placeholder: 'Select a model',
}); searchInputPlaceholder: 'Search models...',
searchInputCssClass: 'text_pole',
width: '100%',
templateResult: getMancerModelTemplate,
});
}
}); });