removed old line wrapper hack

This commit is contained in:
PMKuipers 2023-07-18 13:19:36 +02:00
parent 359d886767
commit 64f3b96dfc
2 changed files with 1 additions and 23 deletions

View File

@ -14,7 +14,7 @@ import RVComponents from './report-viewer-components';
import TSComponents from './treestudyplan-components';
import Debugger from './debugger';
import {ProcessStudyplans, fixLineWrappers} from './studyplan-processor';
import {ProcessStudyplans} from './studyplan-processor';
import PortalVue from './portal-vue';
@ -32,8 +32,6 @@ debug.enable();
* @param {Object} arg Arguments passed
*/
export function init(type="myreport",arg) {
// Make sure on window resize, the line wrappers are repositioned, to fix scrolling issues
window.addEventListener('resize',fixLineWrappers);
let app = new Vue({
el: '#root',
data: {

View File

@ -123,23 +123,3 @@ export function ProcessStudyplan(studyplan){
}
return studyplan;
}
/**
* Update the line wrapper elements to properly display the lines between items
* TODO: For a short time, during the loading time of the page, the arrows get messed up if the frame is scrolled
* Somehow this is not the case after a short while. This phenomenon must be investigated.
*/
export function fixLineWrappers(){
let elmLineWrappers = document.getElementsByClassName('l-leaderline-linewrapper');
console.info("Request line wrapper fix @",(Date.now() - window.performance.timeOrigin)/1000.0);
for(let i =0; i < elmLineWrappers.length; i++){
const elm = elmLineWrappers[i];
elm.style.transform = '';
let rectWrapper = elm.getBoundingClientRect();
console.info("Line wrapper",elm,rectWrapper,(Date.now() - window.performance.timeOrigin)/1000.0);
// Move to the origin of coordinates as the document
elm.style.transform = 'translate(' +
((rectWrapper.left + window.scrollX ) * -1) + 'px, ' +
((rectWrapper.top + window.scrollY ) * -1) + 'px)';
}
}