mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
revert back to 1 http request per lva menu list for performance reasons since usually 1-2 lva are slow and the rest load quickly; many menu_lv.inc scripts would need to be loaded via require instead of require_once but that breaks some of them; only table height calc on watcher; why does an english teacher need a mathe online link?;
This commit is contained in:
@@ -47,16 +47,32 @@ export default {
|
||||
this.lvs[this.currentSemester].lvs = res.data.retval || [];
|
||||
this.firstLoad = false;
|
||||
|
||||
this.$api.call(ApiAddons.getMultipleLvMenu(this.lvs[this.currentSemester].lvs, this.currentSemester)).then(res => {
|
||||
if(res.data) {
|
||||
Object.entries(res.data).forEach((entry) => {
|
||||
// entry[0] -> key -> lvid
|
||||
// entry[1] -> value -> menu
|
||||
const lv = this.lvs[this.currentSemester].lvs.find(lv => lv.lehrveranstaltung_id == entry[0])
|
||||
lv.menu = entry[1]
|
||||
})
|
||||
}
|
||||
// pretty slow to load all at once if one lva has a weird moodle / lvinfo situation
|
||||
// that multiplies the loadtime for everything by a factor of 3-5
|
||||
|
||||
// this.$api.call(ApiAddons.getMultipleLvMenu(this.lvs[this.currentSemester].lvs, this.currentSemester)).then(res => {
|
||||
// if(res.data) {
|
||||
// Object.entries(res.data).forEach((entry) => {
|
||||
// // entry[0] -> key -> lvid
|
||||
// // entry[1] -> value -> menu
|
||||
// const lv = this.lvs[this.currentSemester].lvs.find(lv => lv.lehrveranstaltung_id == entry[0])
|
||||
// lv.menu = entry[1]
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
this.lvs[this.currentSemester].lvs.forEach(lv=>{
|
||||
|
||||
this.$api.call(ApiAddons.getLvMenu(lv.lehrveranstaltung_id, this.currentSemester)).then(res => {
|
||||
if(res.data) {
|
||||
|
||||
const lvProp = this.lvs[this.currentSemester].lvs.find(lv2 => lv2.lehrveranstaltung_id == lv.lehrveranstaltung_id)
|
||||
lvProp.menu = res.data
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -237,6 +237,16 @@ export default {
|
||||
if(this.$refs.mylvTable) {
|
||||
console.log('watcher inside if ref table clause')
|
||||
this.$refs.mylvTable.tabulator.setData(newVal);
|
||||
|
||||
const tableID = this.tabulatorUuid ? ('-' + this.tabulatorUuid) : ''
|
||||
const tableDataSet = document.getElementById('filterTableDataset' + tableID);
|
||||
if(!tableDataSet) return
|
||||
const rect = tableDataSet.getBoundingClientRect();
|
||||
|
||||
const h = window.visualViewport.height - rect.top - 100
|
||||
if(this.$refs.mylvTable) {
|
||||
this.$refs.mylvTable.$refs.table.style.setProperty('height', h+'px')
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
|
||||
Reference in New Issue
Block a user