Skip to content
Snippets Groups Projects
Commit adc81255 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 98b7a8ef
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,19 @@ export default { ...@@ -35,7 +35,19 @@ export default {
isOpen: this.open, 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: { watch: {
open(state) { open(state) {
this.isOpen = state; this.isOpen = state;
......
...@@ -154,9 +154,17 @@ export default { ...@@ -154,9 +154,17 @@ export default {
}, },
mounted() { mounted() {
this.initCurrentData(); this.initCurrentData();
window.addEventListener('resize', this.calcContentHeight); 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() { destroyed() {
window.removeEventListener('resize', this.calcContentHeight); window.removeEventListener('resize', this.calcContentHeight);
}, },
...@@ -172,8 +180,15 @@ export default { ...@@ -172,8 +180,15 @@ export default {
this.currentEndTime = this.endTime; this.currentEndTime = this.endTime;
this.oembedData = this.oembed; this.oembedData = this.oembed;
if (this.oembedData !== null) { if (this.oembedData !== null) {
this.calcContentHeight();
this.updateTime(); this.updateTime();
this.calcContentHeight();
}
},
recalculateContentHeight(data){
if (this.$parent._uid === data.uid) {
if (this.oembedData !== null) {
this.calcContentHeight();
}
} }
}, },
addTimeData(data) { addTimeData(data) {
......
...@@ -36,6 +36,12 @@ export default { ...@@ -36,6 +36,12 @@ export default {
mounted() { mounted() {
this.isActive = this.selected; this.isActive = this.selected;
}, },
updated () {
if (this.isActive) {
STUDIP.eventBus.emit('courseware:update-tab',{ 'uid': this._uid });
}
},
watch: { watch: {
selected(newValue) { selected(newValue) {
this.isActive = newValue; this.isActive = newValue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment