summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorWu Cheng-Han2016-09-18 17:04:33 +0800
committerWu Cheng-Han2016-09-18 17:04:33 +0800
commit93ec43c3dcb9a45992b525c8ac1bd292c60bd296 (patch)
tree166b6d8d53866ac9aa276e2ea7c248ff3bb60dbb /public
parenta9d7d7438f7593fcd7a7619a8c2e8088e970166e (diff)
Fix revision viewer might not update after data init, try to use editor operation queue to enhance updateView performance
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 8216b61a..41618ccf 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -138,7 +138,7 @@ function wrapTextWith(cm, symbol) {
}
var idleTime = 300000; //5 mins
-var updateViewDebounce = 200;
+var updateViewDebounce = 100;
var cursorMenuThrottle = 50;
var cursorActivityDebounce = 50;
var cursorAnimatePeriod = 100;
@@ -1761,6 +1761,7 @@ function initRevisionViewer() {
});
revisionInsertAnnotation = revisionViewer.annotateScrollbar({ className:"CodeMirror-insert-match" });
revisionDeleteAnnotation = revisionViewer.annotateScrollbar({ className:"CodeMirror-delete-match" });
+ checkRevisionViewer();
}
$('#revisionModalDownload').click(function () {
if (!revision) return;
@@ -3248,7 +3249,9 @@ function refreshView() {
updateViewInner();
}
-var updateView = _.debounce(updateViewInner, updateViewDebounce);
+var updateView = _.debounce(function () {
+ editor.operation(updateViewInner);
+}, updateViewDebounce);
var lastResult = null;
var postUpdateEvent = null;