Skip to content
Snippets Groups Projects
Commit 0eadb752 authored by B. Sc Pius Gyamenah's avatar B. Sc Pius Gyamenah :speech_balloon: Committed by Jan-Hendrik Willms
Browse files

Biest #1002

Closes #1002 and #1058

Merge request studip/studip!883
parent 9439a370
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,19 @@ export default {
isOpen: this.open,
};
},
methods: {},
mounted(){
this.updateCollapsible();
},
updated() {
this.updateCollapsible();
},
methods: {
updateCollapsible() {
if (this.isOpen) {
STUDIP.eventBus.emit('courseware:update-collapsible', { 'uid': this._uid });
}
}
},
watch: {
open(state) {
this.isOpen = state;
......
......@@ -154,9 +154,17 @@ export default {
},
mounted() {
this.initCurrentData();
window.addEventListener('resize', this.calcContentHeight);
},
created () {
STUDIP.eventBus.on('courseware:update-tab', (data) => {
this.recalculateContentHeight(data);
});
STUDIP.eventBus.on('courseware:update-collapsible', (data) => {
this.recalculateContentHeight(data);
});
},
destroyed() {
window.removeEventListener('resize', this.calcContentHeight);
},
......@@ -172,8 +180,15 @@ export default {
this.currentEndTime = this.endTime;
this.oembedData = this.oembed;
if (this.oembedData !== null) {
this.calcContentHeight();
this.updateTime();
this.calcContentHeight();
}
},
recalculateContentHeight(data){
if (this.$parent._uid === data.uid) {
if (this.oembedData !== null) {
this.calcContentHeight();
}
}
},
addTimeData(data) {
......
......@@ -36,6 +36,12 @@ export default {
mounted() {
this.isActive = this.selected;
},
updated () {
if (this.isActive) {
STUDIP.eventBus.emit('courseware:update-tab',{ 'uid': this._uid });
}
},
watch: {
selected(newValue) {
this.isActive = newValue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment