Bugfix in course span selector

This commit is contained in:
PMKuipers 2023-08-31 21:10:30 +02:00
parent ee7e3ba61e
commit 213ad3703e
3 changed files with 25 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2120,14 +2120,29 @@ export default {
// Determine last free slot following this one in the layer // Determine last free slot following this one in the layer
for(let i = this.slotindex + 1; i <= this.page.periods; i++){ for(let i = this.slotindex + 1; i <= this.page.periods; i++){
if(this.line.slots && this.line.slots[i] && this.line.slots[i].courses){ if(this.line.slots && this.line.slots[i] && this.line.slots[i].courses){
const l = this.line.slots[i].courses; const clist = this.line.slots[i].courses;
const f = this.line.slots[i-1].filters; // next filter is in the same slot const flist = this.line.slots[i-1].filters; // next filter is in the same slot
if(l[this.layer] || f[this.layer]) { let busy = false;
// slot is busy in this layer. for(const ix in clist) {
if( clist[ix].layer == this.layer) {
busy = true; // slot is busy in this layer.
break; break;
} else {
freeIndex = i;
} }
}
for(const ix in flist) {
if( flist[ix].layer == this.layer) {
busy = true; // slot is busy in this layer.
break;
}
}
if(! busy) {
// slot is free in this layer
freeIndex = i;
} else {
break; // stop checking next slots
}
} else { } else {
break; // stop processing break; // stop processing
} }