sudyline header height fix

This commit is contained in:
PMKuipers 2023-07-18 13:40:30 +02:00
parent e3218a9ef6
commit fa1e3daa6f

View file

@ -1525,26 +1525,18 @@ export default {
// When one of those updates is received, record the height and recalculate the total height of the // When one of those updates is received, record the height and recalculate the total height of the
// header // header
if(lineid == this.value.id){ if(lineid == this.value.id){
let offset = "";
if(this.value.sequence==1 || this.value.sequence==this.numlines) {
const cstyle = getComputedStyle(this.$refs.mainEl);
offset = " + " +cstyle.borderTopWidth + " + " + cstyle.borderBottomWidth;
//debug.info("Adding extra height to offset border",cstyle);
}
const items = document.querySelectorAll( const items = document.querySelectorAll(
`.t-studyplan-content-edit .t-studyline-slot-0[data-studyline='${this.value.id}']`); `.t-studyline-slot-0[data-studyline='${this.value.id}']`);
// determine the height of all the lines and add them up.
let heightSum = 0; let heightSum = 0;
for(const ix in items){ items.forEach((el) => {
debug.info(items[ix]); const height = el.offsetHeight;
const height = items[ix].clientHeight;
heightSum += height; heightSum += height;
} });
debug.info(`Line height change line ${lineid} layer ${layerid}`, items, heightSum); const heightStyle=`${heightSum-0.5}px`;
const heightStyle=`calc( ${heightSum}px ${offset})`; debug.info(`Received line height change line ${lineid} to ${heightStyle}`);
//debug.info(`Received line height change line ${lineid} to ${heightStyle}`);
this.$refs.mainEl.style.height = heightStyle; this.$refs.mainEl.style.height = heightStyle;
} }
} }