From 40f267fa0f6ea95b10a7ff62b11a16b0a0ba55fa Mon Sep 17 00:00:00 2001 From: Michal Tomaszewski Date: Thu, 16 Nov 2017 11:56:32 -0800 Subject: [PATCH] Clear cached scroll offset on window scroll MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to avoid a bug where the toolbar, highlighter, etc elements’ position would be off in editors positioned inside a scrollable window. --- src/canvas/view/CanvasView.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/canvas/view/CanvasView.js b/src/canvas/view/CanvasView.js index cca9d230d..7be33d503 100644 --- a/src/canvas/view/CanvasView.js +++ b/src/canvas/view/CanvasView.js @@ -5,6 +5,7 @@ module.exports = Backbone.View.extend({ initialize(o) { _.bindAll(this, 'renderBody', 'onFrameScroll', 'clearOff'); + window.onscroll = this.clearOff this.config = o.config || {}; this.em = this.config.em || {}; this.ppfx = this.config.pStylePrefix || '';