|
|
@ -310,18 +310,24 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
framework.setContentGetter(function () {
|
|
|
|
framework.setContentGetter(function () {
|
|
|
|
|
|
|
|
CodeMirror.removeCursors();
|
|
|
|
var content = CodeMirror.getContent();
|
|
|
|
var content = CodeMirror.getContent();
|
|
|
|
content.highlightMode = CodeMirror.highlightMode;
|
|
|
|
content.highlightMode = CodeMirror.highlightMode;
|
|
|
|
previewPane.draw();
|
|
|
|
previewPane.draw();
|
|
|
|
return content;
|
|
|
|
return content;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
framework.onCursorUpdate(CodeMirror.setRemoteCursor);
|
|
|
|
var cursorTo;
|
|
|
|
framework.setCursorGetter(CodeMirror.getCursor);
|
|
|
|
var updateCursor = function () {
|
|
|
|
editor.on('cursorActivity', function () {
|
|
|
|
if (cursorTo) { clearTimeout(cursorTo); }
|
|
|
|
if (editor._noCursorUpdate) { return; }
|
|
|
|
if (editor._noCursorUpdate) { return; }
|
|
|
|
|
|
|
|
cursorTo = setTimeout(function () {
|
|
|
|
framework.updateCursor();
|
|
|
|
framework.updateCursor();
|
|
|
|
});
|
|
|
|
}, 500); // 500ms to make sure it is sent after chainpad sync
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
framework.onCursorUpdate(CodeMirror.setRemoteCursor);
|
|
|
|
|
|
|
|
framework.setCursorGetter(CodeMirror.getCursor);
|
|
|
|
|
|
|
|
editor.on('cursorActivity', updateCursor);
|
|
|
|
|
|
|
|
|
|
|
|
framework.onEditableChange(function () {
|
|
|
|
framework.onEditableChange(function () {
|
|
|
|
editor.setOption('readOnly', framework.isLocked() || framework.isReadOnly());
|
|
|
|
editor.setOption('readOnly', framework.isLocked() || framework.isReadOnly());
|
|
|
|