Cursor improvements in pad, code and slide
This commit is contained in:
@@ -466,17 +466,23 @@ define([
|
||||
});
|
||||
|
||||
framework.setContentGetter(function () {
|
||||
CodeMirror.removeCursors();
|
||||
var content = CodeMirror.getContent();
|
||||
Slide.update(content.content);
|
||||
return content;
|
||||
});
|
||||
|
||||
var cursorTo;
|
||||
var updateCursor = function () {
|
||||
if (cursorTo) { clearTimeout(cursorTo); }
|
||||
if (editor._noCursorUpdate) { return; }
|
||||
cursorTo = setTimeout(function () {
|
||||
framework.updateCursor();
|
||||
}, 500); // 500ms to make sure it is sent after chainpad sync
|
||||
};
|
||||
framework.onCursorUpdate(CodeMirror.setRemoteCursor);
|
||||
framework.setCursorGetter(CodeMirror.getCursor);
|
||||
editor.on('cursorActivity', function () {
|
||||
if (editor._noCursorUpdate) { return; }
|
||||
framework.updateCursor();
|
||||
});
|
||||
editor.on('cursorActivity', updateCursor);
|
||||
|
||||
framework.onEditableChange(function () {
|
||||
editor.setOption('readOnly', framework.isLocked() || framework.isReadOnly());
|
||||
|
||||
Reference in New Issue
Block a user