fixing border on startup. see #603
This commit is contained in:
parent
3e176f00b1
commit
73d6fdedc8
2 changed files with 5 additions and 9 deletions
|
|
@ -25,6 +25,7 @@ import {
|
|||
getChatGPTWebModelsList_HTML,
|
||||
isAPIKeyValue,
|
||||
getConnectionType,
|
||||
setTomSelectBorder
|
||||
} from '../js/mzta-utils.js';
|
||||
import {
|
||||
injectConnectionUI,
|
||||
|
|
@ -103,6 +104,7 @@ async function restoreOptions() {
|
|||
}
|
||||
if (element.tomselect) {
|
||||
element.tomselect.setValue(element.value, true);
|
||||
setTomSelectBorder(element.tomselect);
|
||||
}
|
||||
break;
|
||||
case 'textarea':
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import {
|
|||
validateCustomData_ChatGPTWeb,
|
||||
sanitizeChatGPTModelData,
|
||||
sanitizeChatGPTWebCustomData,
|
||||
prepareOriginURL
|
||||
prepareOriginURL,
|
||||
setTomSelectBorder
|
||||
} from '../../js/mzta-utils.js';
|
||||
import { openAICompConfigs } from '../../js/api/openai_comp_configs.js';
|
||||
import {
|
||||
|
|
@ -1043,6 +1044,7 @@ export async function injectConnectionUI({
|
|||
if (el.value) {
|
||||
ts.setValue(el.value);
|
||||
}
|
||||
console.log(">>>>>>>>>>>>>>> el.value: " + el.value);
|
||||
setTomSelectBorder(ts);
|
||||
}
|
||||
});
|
||||
|
|
@ -1261,14 +1263,6 @@ function toggleTomSelectDisabled(element, disabled) {
|
|||
}
|
||||
}
|
||||
|
||||
function setTomSelectBorder(el){
|
||||
if (el.getValue() === "") {
|
||||
el.control.style.border = '2px solid red';
|
||||
} else {
|
||||
el.control.style.border = '1px solid #d0d0d0';
|
||||
}
|
||||
}
|
||||
|
||||
function getModelEl(model, modelId_prefix) {
|
||||
return document.getElementById((modelId_prefix ? modelId_prefix : '') + model);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue