From 82a15e413d474886c9dd757a5993f870da862833 Mon Sep 17 00:00:00 2001 From: Petr Klus Date: Tue, 21 Oct 2014 23:56:46 +0200 Subject: [PATCH] added captureVerticalWheel option --- js/jquery.fn.gantt.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/jquery.fn.gantt.js b/js/jquery.fn.gantt.js index 708c9dc..90cab4d 100644 --- a/js/jquery.fn.gantt.js +++ b/js/jquery.fn.gantt.js @@ -44,7 +44,8 @@ onItemClick: function (data) { return; }, onAddClick: function (data) { return; }, onRender: function() { return; }, - scrollToToday: true + scrollToToday: true, + captureVerticalWheel: true }; /** @@ -1292,6 +1293,12 @@ // Move chart via mousewheel wheelScroll: function (element, e) { + + if (!settings.captureVerticalWheel && Math.abs(e.originalEvent.deltaY) > Math.abs(e.originalEvent.deltaX)) { + // short-circuit vertical scroll - we do not want to intercept that one! + return + } + e.preventDefault(); // e is a jQuery Event // attempts to normalize scroll wheel velocity