diff options
author | Wu Cheng-Han | 2017-01-02 11:06:02 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2017-01-02 11:06:02 +0800 |
commit | db0ea715c61c1b82794403cd045f6ccac5aa66c9 (patch) | |
tree | 609c5f2b4621cee1a9db0f0981a4fdee42fd555c /public | |
parent | 0db4358adb12b2df1051874829f658496df6910c (diff) |
Update to improve editor performance by debounce checkEditorScrollbar event
Diffstat (limited to '')
-rw-r--r-- | public/js/index.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js index 2e0513c2..56766657 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1223,7 +1223,11 @@ function checkSyncToggle() { } } -function checkEditorScrollbar() { +var checkEditorScrollbar = _.debounce(function () { + editor.operation(checkEditorScrollbarInner); +}, 50); + +function checkEditorScrollbarInner() { // workaround simple scroll bar knob // will get wrong position when editor height changed var scrollInfo = editor.getScrollInfo(); |