Skip to content

Commit db0ea71

Browse files
committed
Update to improve editor performance by debounce checkEditorScrollbar event
1 parent 0db4358 commit db0ea71

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

public/js/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,11 @@ function checkSyncToggle() {
12231223
}
12241224
}
12251225

1226-
function checkEditorScrollbar() {
1226+
var checkEditorScrollbar = _.debounce(function () {
1227+
editor.operation(checkEditorScrollbarInner);
1228+
}, 50);
1229+
1230+
function checkEditorScrollbarInner() {
12271231
// workaround simple scroll bar knob
12281232
// will get wrong position when editor height changed
12291233
var scrollInfo = editor.getScrollInfo();

0 commit comments

Comments
 (0)