fix scrolling over linter issues in usercss mode

This commit is contained in:
tophf 2017-12-28 07:01:43 +03:00
parent c1dd196acd
commit a66c377d8a

View File

@ -333,11 +333,13 @@ function createSourceEditor(style) {
} }
} }
function headerOnScroll({deltaY, deltaMode, shiftKey}) { function headerOnScroll({target, deltaY, deltaMode, shiftKey}) {
if (deltaY < 0 && this.scrollTop || while ((target = target.parentElement)) {
deltaY > 0 && this.scrollTop + this.clientHeight < this.scrollHeight) { if (deltaY < 0 && target.scrollTop ||
deltaY > 0 && target.scrollTop + target.clientHeight < target.scrollHeight) {
return; return;
} }
}
cm.display.scroller.scrollTop += cm.display.scroller.scrollTop +=
// WheelEvent.DOM_DELTA_LINE // WheelEvent.DOM_DELTA_LINE
deltaMode === 1 ? deltaY * cm.display.cachedTextHeight : deltaMode === 1 ? deltaY * cm.display.cachedTextHeight :