From a66c377d8ac9afb099412fba0908af3acd83a304 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 28 Dec 2017 07:01:43 +0300 Subject: [PATCH] fix scrolling over linter issues in usercss mode --- edit/source-editor.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/edit/source-editor.js b/edit/source-editor.js index c43dfac6..f41dac65 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -333,10 +333,12 @@ function createSourceEditor(style) { } } - function headerOnScroll({deltaY, deltaMode, shiftKey}) { - if (deltaY < 0 && this.scrollTop || - deltaY > 0 && this.scrollTop + this.clientHeight < this.scrollHeight) { - return; + function headerOnScroll({target, deltaY, deltaMode, shiftKey}) { + while ((target = target.parentElement)) { + if (deltaY < 0 && target.scrollTop || + deltaY > 0 && target.scrollTop + target.clientHeight < target.scrollHeight) { + return; + } } cm.display.scroller.scrollTop += // WheelEvent.DOM_DELTA_LINE