First version, for githup; UNSTABLE, DO NOT USE!
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
function allNameKrValid() {
|
||||
var isValid = true;
|
||||
|
||||
$('.ajax-input-namekr').each(function () {
|
||||
if ($(this).val() === '---') {
|
||||
isValid = false;
|
||||
return false; // break loop
|
||||
}
|
||||
});
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
function updateSelectKrDiv() {
|
||||
const krDiv = $('.noKampfrichterDiv');
|
||||
|
||||
if (krDiv.length !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (allNameKrValid()) {
|
||||
krDiv.css('display', 'none');
|
||||
} else {
|
||||
krDiv.css('display', 'flex');
|
||||
}
|
||||
}
|
||||
|
||||
// initial check
|
||||
updateSelectKrDiv();
|
||||
|
||||
// react to changes
|
||||
$('.ajax-input-namekr').on('change', function () {
|
||||
updateSelectKrDiv();
|
||||
});
|
||||
Reference in New Issue
Block a user