scroll-sync, changed scroll speed

pull/5456/head
Roman Roelofsen 8 years ago
parent 9775de86a5
commit ab3a1a5d4e
  1. 8
      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;
});
}

Loading…
Cancel
Save