From ab3a1a5d4e71dff74d291fc9d2bb9387d44c025a Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Wed, 10 May 2017 14:49:13 +0200 Subject: [PATCH] scroll-sync, changed scroll speed --- frontend/app/components/wp-table/wp-table-scroll-sync.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/app/components/wp-table/wp-table-scroll-sync.ts b/frontend/app/components/wp-table/wp-table-scroll-sync.ts index 74f94cebc1..2aeed9870c 100644 --- a/frontend/app/components/wp-table/wp-table-scroll-sync.ts +++ b/frontend/app/components/wp-table/wp-table-scroll-sync.ts @@ -31,7 +31,7 @@ import {IAugmentedJQuery} from "angular"; const selectorTableSide = ".work-packages-tabletimeline--table-side"; const selectorTimelineSide = ".work-packages-tabletimeline--timeline-side"; const jQueryScrollSyncEventNamespace = ".scroll-sync"; -const workPackageTableRowHeight = 41; +const scrollStep = 15; function getXandYScrollDeltas(ev: WheelEvent): [number, number] { @@ -47,7 +47,7 @@ function getXandYScrollDeltas(ev: WheelEvent): [number, number] { } function getPlattformAgnosticScrollAmount(deltaY: number) { - return workPackageTableRowHeight; + return scrollStep; } function syncWheelEvent(jev: JQueryEventObject, elementTable: JQuery, elementTimeline: JQuery) { @@ -64,9 +64,9 @@ function syncWheelEvent(jev: JQueryEventObject, elementTable: JQuery, elementTim window.requestAnimationFrame(function () { elementTable[0].scrollTop = elementTable[0].scrollTop + delta; - elementTable[0].scrollLeft = elementTable[0].scrollLeft + ev.deltaX; + elementTable[0].scrollLeft = elementTable[0].scrollLeft + scrollStep; elementTimeline[0].scrollTop = elementTimeline[0].scrollTop + delta; - elementTimeline[0].scrollLeft = elementTimeline[0].scrollLeft + ev.deltaX; + elementTimeline[0].scrollLeft = elementTimeline[0].scrollLeft + scrollStep; }); }