setting tomselect border red when empty. see #603
This commit is contained in:
parent
ef3ea4a2c0
commit
32e3e40cfc
1 changed files with 12 additions and 0 deletions
|
|
@ -1037,9 +1037,13 @@ export async function injectConnectionUI({
|
||||||
direction: "asc"
|
direction: "asc"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
ts.on('change', function() {
|
||||||
|
setTomSelectBorder(this);
|
||||||
|
});
|
||||||
if (el.value) {
|
if (el.value) {
|
||||||
ts.setValue(el.value);
|
ts.setValue(el.value);
|
||||||
}
|
}
|
||||||
|
setTomSelectBorder(ts);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1257,6 +1261,14 @@ 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) {
|
function getModelEl(model, modelId_prefix) {
|
||||||
return document.getElementById((modelId_prefix ? modelId_prefix : '') + model);
|
return document.getElementById((modelId_prefix ? modelId_prefix : '') + model);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue