Bugfix in course span selector
This commit is contained in:
parent
ee7e3ba61e
commit
213ad3703e
2
amd/build/studyplan-editor-components.min.js
vendored
2
amd/build/studyplan-editor-components.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2112,7 +2112,7 @@ export default {
|
|||
},
|
||||
maxSpan(){
|
||||
// Determine the maximum span for components in this slot
|
||||
// Used for setting the max in the timing adjustment screen (s)
|
||||
// Used for setting the max in the timing adjustment screen(s)
|
||||
// And for checking the filter types
|
||||
|
||||
// Assume this slot is first one available
|
||||
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user