From a53fb162a8b5c008f8be35a25e6d26ea6ca5aa27 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 24 Dec 2017 14:28:25 +0300 Subject: [PATCH] unbind 'display' listeners on first run --- vendor-overwrites/colorpicker/colorview.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vendor-overwrites/colorpicker/colorview.js b/vendor-overwrites/colorpicker/colorview.js index 48fe3bb0..1b0f26b2 100644 --- a/vendor-overwrites/colorpicker/colorview.js +++ b/vendor-overwrites/colorpicker/colorview.js @@ -65,9 +65,7 @@ const textHeight = cm.display.cachedTextHeight; const height = cm.display.lastWrapHeight; if (!height || !textHeight) return; - const numLines = Math.ceil(height / textHeight); - if (numLines >= maxRenderChunkSize) return; - maxRenderChunkSize = numLines; + maxRenderChunkSize = Math.max(20, Math.ceil(height / textHeight)); cm.off('update', CM_EVENTS.update); }, mousedown(cm, event) {