Fix issue with cursor moving back to 0,0 after a refresh.

This commit is contained in:
jkaplon 2016-11-26 22:43:07 -05:00
parent e4eb8cb1ec
commit 603a9fd3e8

View File

@ -77,7 +77,11 @@
socket.on('download allNotes', function(msg){
//console.log(msg);
userKeypress = false; // Set this back to false, still getting infinite loop.
var cursorPos = editor.getCursor();
var scrollTop = editor.getScrollerElement().scrollTop;
editor.getDoc().setValue(msg);
editor.setCursor(cursorPos);
editor.scrollTo(null, scrollTop);
});
document.onkeydown = function(){ userKeypress = true; };