mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Job refactor 2: less hardcoded lists (#60578)
* Job refactor 2: less hardcoded lists * Obsessed can happen
This commit is contained in:
@@ -72,3 +72,7 @@
|
||||
.antagonistpositions {
|
||||
background-color: #6d3f40;
|
||||
}
|
||||
|
||||
.undefineddepartment {
|
||||
background-color: #111cf7;
|
||||
}
|
||||
|
||||
+7
-13
@@ -1,16 +1,10 @@
|
||||
function toggle_head(source, ext) {
|
||||
document.getElementById(source.id.slice(0, -4) + ext).checked = source.checked;
|
||||
}
|
||||
|
||||
function toggle_checkboxes(source, ext) {
|
||||
var checkboxes = document.getElementsByClassName(source.name);
|
||||
for (var i = 0, n = checkboxes.length; i < n; i++) {
|
||||
checkboxes[i].checked = source.checked;
|
||||
if (checkboxes[i].id) {
|
||||
var idfound = document.getElementById(checkboxes[i].id.slice(0, -4) + ext);
|
||||
if (idfound) {
|
||||
idfound.checked = source.checked;
|
||||
}
|
||||
function toggle_other_checkboxes(source, copycats_str, our_index_str) {
|
||||
const copycats = parseInt(copycats_str);
|
||||
const our_index = parseInt(our_index_str);
|
||||
for (var i = 1; i <= copycats; i++) {
|
||||
if(i === our_index) {
|
||||
continue;
|
||||
}
|
||||
document.getElementById(source.id.slice(0, -1) + i).checked = source.checked;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user