Fix bug that prevented dropping new courses
This commit is contained in:
parent
315794ec86
commit
d265774546
3 changed files with 13 additions and 5 deletions
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
|
@ -1302,6 +1302,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
trashbin_accepts(type){
|
||||||
|
if(type.item){
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
countLineLayers(line){
|
countLineLayers(line){
|
||||||
// For some optimization, we cache the value of this calculation for about a second
|
// For some optimization, we cache the value of this calculation for about a second
|
||||||
// Would be a lot nicer if we could use a computed property for this.....
|
// Would be a lot nicer if we could use a computed property for this.....
|
||||||
|
@ -1509,7 +1516,7 @@ export default {
|
||||||
mode='copy'
|
mode='copy'
|
||||||
class='t-item-deletebox text-danger border-danger'
|
class='t-item-deletebox text-danger border-danger'
|
||||||
@drop='deleteStudyItem'
|
@drop='deleteStudyItem'
|
||||||
:accepts-type="['gradable-item','filter-item']"
|
:accepts-type="trashbin_accepts"
|
||||||
><i class='fa fa-trash'></i>
|
><i class='fa fa-trash'></i>
|
||||||
</drop>
|
</drop>
|
||||||
<span class='control deletable'>
|
<span class='control deletable'>
|
||||||
|
@ -1960,6 +1967,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onDrop(event) {
|
onDrop(event) {
|
||||||
|
debug.info(event);
|
||||||
this.hover.component = null;
|
this.hover.component = null;
|
||||||
this.hover.type = null;
|
this.hover.type = null;
|
||||||
|
|
||||||
|
@ -1985,7 +1993,7 @@ export default {
|
||||||
}
|
}
|
||||||
else if(event.type.component){
|
else if(event.type.component){
|
||||||
|
|
||||||
if(event.type.type == "course"){
|
if(event.type.type == "gradable"){
|
||||||
call([{
|
call([{
|
||||||
methodname: 'local_treestudyplan_add_studyitem',
|
methodname: 'local_treestudyplan_add_studyitem',
|
||||||
args: {
|
args: {
|
||||||
|
@ -2325,7 +2333,7 @@ export default {
|
||||||
}} <b-form-select
|
}} <b-form-select
|
||||||
class=""
|
class=""
|
||||||
size="sm" @change="change_span" v-model="value.span">
|
size="sm" @change="change_span" v-model="value.span">
|
||||||
<b-form-select-option v-for="(n,i) in maxspan" :value='n'
|
<b-form-select-option v-for="(n,i) in maxspan" :value='n' :key='i'
|
||||||
>{{ n }}</b-form-select-option>
|
>{{ n }}</b-form-select-option>
|
||||||
</b-form-select
|
</b-form-select
|
||||||
> {{
|
> {{
|
||||||
|
|
Loading…
Reference in a new issue