summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorWu Cheng-Han2016-10-17 18:11:28 +0800
committerWu Cheng-Han2016-10-17 18:11:28 +0800
commite097622098b9c77a91f40306547b4b07fd258402 (patch)
tree2be64ab3906c6f34fb0f186a19a59aa8768b52d1 /public/js
parent70a52e2eaed25686160f0d1be1682f85230d9408 (diff)
Change to raise socket io reconnection attempts and make editor only available after refresh event received
Diffstat (limited to '')
-rw-r--r--public/js/index.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 5bddfbd0..7294a5ba 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -2262,7 +2262,8 @@ window.havePermission = havePermission;
var io = require("socket.io-client");
var socket = io.connect({
path: urlpath ? '/' + urlpath + '/socket.io/' : '',
- timeout: 5000 //5 secs to timeout
+ timeout: 5000, //5 secs to timeout,
+ reconnectionAttempts: 20 // retry 20 times on connect failed
});
//overwrite original event for checking login state
var on = socket.on;
@@ -2636,6 +2637,8 @@ socket.on('refresh', function (data) {
scrollToHash();
}, 1);
}
+ if (editor.getOption('readOnly'))
+ editor.setOption('readOnly', false);
});
var EditorClient = ot.EditorClient;
@@ -2689,9 +2692,6 @@ socket.on('doc', function (obj) {
updateView();
}
- if (editor.getOption('readOnly'))
- editor.setOption('readOnly', false);
-
restoreInfo();
});