From 4ce862c5b49a6d5d8e6fd69c10378d16b855e1ee Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Mon, 5 Feb 2018 18:11:43 +0100 Subject: [PATCH] scroll: use wheelpropagation. Ref #10772 Once the vertical scrollbar comes to its end position, it should allow the page scroll bar to start scrolling. --- public/app/core/components/ScrollBar/ScrollBar.tsx | 5 +++-- public/app/core/components/scroll/scroll.ts | 4 +++- public/app/features/panel/panel_directive.ts | 4 +++- public/app/plugins/panel/graph/legend.ts | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/app/core/components/ScrollBar/ScrollBar.tsx b/public/app/core/components/ScrollBar/ScrollBar.tsx index 49a200b0f3b..7d9e015df94 100644 --- a/public/app/core/components/ScrollBar/ScrollBar.tsx +++ b/public/app/core/components/ScrollBar/ScrollBar.tsx @@ -7,7 +7,6 @@ export interface Props { } export default class ScrollBar extends React.Component { - private container: any; private ps: PerfectScrollbar; @@ -16,7 +15,9 @@ export default class ScrollBar extends React.Component { } componentDidMount() { - this.ps = new PerfectScrollbar(this.container); + this.ps = new PerfectScrollbar(this.container, { + wheelPropagation: true, + }); } componentDidUpdate() { diff --git a/public/app/core/components/scroll/scroll.ts b/public/app/core/components/scroll/scroll.ts index 99245ed3331..720334d8973 100644 --- a/public/app/core/components/scroll/scroll.ts +++ b/public/app/core/components/scroll/scroll.ts @@ -6,7 +6,9 @@ export function geminiScrollbar() { return { restrict: 'A', link: function(scope, elem, attrs) { - let scrollbar = new PerfectScrollbar(elem[0]); + let scrollbar = new PerfectScrollbar(elem[0], { + wheelPropagation: true, + }); let lastPos = 0; appEvents.on( diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index 01730e2fede..dec7868a553 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -100,7 +100,9 @@ module.directive('grafanaPanel', function($rootScope, $document, $timeout) { // update scrollbar after mounting ctrl.events.on('component-did-mount', () => { if (ctrl.__proto__.constructor.scrollable) { - panelScrollbar = new PerfectScrollbar(panelContent[0]); + panelScrollbar = new PerfectScrollbar(panelContent[0], { + wheelPropagation: true, + }); } }); diff --git a/public/app/plugins/panel/graph/legend.ts b/public/app/plugins/panel/graph/legend.ts index 5db0a122b31..cd43ac58469 100644 --- a/public/app/plugins/panel/graph/legend.ts +++ b/public/app/plugins/panel/graph/legend.ts @@ -246,6 +246,7 @@ module.directive('graphLegend', function(popoverSrv, $timeout) { // Number of pixels the content height can surpass the container height without enabling the scroll bar. scrollYMarginOffset: 2, suppressScrollX: true, + wheelPropagation: true, }; if (!legendScrollbar) {