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
for(let i = this.slotindex + 1; i <= this.page.periods; i++){
if(this.line.slots && this.line.slots[i] && this.line.slots[i].courses){
const l = this.line.slots[i].courses;
const f = this.line.slots[i-1].filters; // next filter is in the same slot
if(l[this.layer] || f[this.layer]) {
// slot is busy in this layer.
const clist = this.line.slots[i].courses;
const flist = this.line.slots[i-1].filters; // next filter is in the same slot
let busy = false;
for(const ix in clist) {
if( clist[ix].layer == this.layer) {
busy = true; // slot is busy in this layer.
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 {
break; // stop processing
}