From 64f3b96dfc86fb0c5e9c2c3e03d949fd354c385b Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Tue, 18 Jul 2023 13:19:36 +0200 Subject: [PATCH] removed old line wrapper hack --- amd/src/page-myreport.js | 4 +--- amd/src/studyplan-processor.js | 20 -------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/amd/src/page-myreport.js b/amd/src/page-myreport.js index 896a5cc..35d95ce 100644 --- a/amd/src/page-myreport.js +++ b/amd/src/page-myreport.js @@ -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: { diff --git a/amd/src/studyplan-processor.js b/amd/src/studyplan-processor.js index d4bd5aa..415ff2d 100644 --- a/amd/src/studyplan-processor.js +++ b/amd/src/studyplan-processor.js @@ -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)'; - } -}