Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shiftOnlyWheelScroll setting (default: true) #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions js/jquery.fn.gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
onItemClick: function (data) { return; },
onAddClick: function (data) { return; },
onRender: function() { return; },
scrollToToday: true
scrollToToday: true,
shiftOnlyWheelScroll: true
};

// custom selector `:findday` used to match on specified day in ms.
Expand Down Expand Up @@ -1181,7 +1182,7 @@
/*
* Dependecies (temporary disabled)
*/
/*
/*
$.each(element.data, function(i, entry) {
$.each(entry.values, function(j, day) {
if (day.id && day.dep)
Expand Down Expand Up @@ -1390,7 +1391,7 @@
}
}
});
});*/
});*/

},
// **Navigation**
Expand Down Expand Up @@ -1536,6 +1537,11 @@

// Move chart via mousewheel
wheelScroll: function (element, e) {
if (settings.shiftOnlyWheelScroll && !e.shiftKey) {
// shift is not held down: break out
return;
}

var delta = e.detail ? e.detail * (-50) : e.wheelDelta / 120 * 50;

core.scrollPanel(element, delta);
Expand Down Expand Up @@ -1939,4 +1945,4 @@
});

};
})(jQuery);
})(jQuery);