Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ <h2 id="config">
<td>
Boolean</td>
</tr>
<tr>
<td>
<code>horizMouseScroll</code></td>
<td>
<code>true</code></td>
<td>
<code>Indicates whether mousescroll controls the horizontal scrolling of the chart.</code></td>
</tr>
</tbody>
</table>

Expand Down
11 changes: 7 additions & 4 deletions js/jquery.fn.gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
// navigation
navigate: "buttons",
scrollToToday: true,
horizMouseScroll: true,
// cookie options
useCookie: false,
cookieKey: "jquery.fn.gantt",
Expand Down Expand Up @@ -360,10 +361,12 @@
var dataPanel = $('<div class="dataPanel" style="width: ' + width + 'px;"/>');

// Handle mousewheel events for scrolling the data panel
var wheel = 'onwheel' in element ?
'wheel' : document.onmousewheel !== undefined ?
'mousewheel' : 'DOMMouseScroll';
$(element).on(wheel, function (e) { core.wheelScroll(element, e); });
if (settings.horizMouseScroll) {
var wheel = 'onwheel' in element ?
'wheel' : document.onmousewheel !== undefined ?
'mousewheel' : 'DOMMouseScroll';
$(element).on(wheel, function (e) { core.wheelScroll(element, e); });
}

// Handle click events and dispatch to registered `onAddClick` function
dataPanel.click(function (e) {
Expand Down