mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Mobile doesn't like select2
This commit is contained in:
parent
d81c94de0b
commit
dc5deaf47c
@ -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) {
|
||||||
|
@ -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,
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user