set user's cursor to either the beginning or end of the document

This commit is contained in:
ansuz
2017-03-20 17:51:56 +01:00
parent 2add39ee40
commit 4a173e30dc
2 changed files with 62 additions and 2 deletions

View File

@@ -64,6 +64,7 @@ define([
logFights: true,
fights: [],
Cryptpad: Cryptpad,
Cursor: Cursor,
};
var emitResize = module.emitResize = function () {
@@ -131,7 +132,7 @@ define([
color: '#fff',
});
var cursor = window.cursor = Cursor(inner);
var cursor = module.cursor = Cursor(inner);
var setEditable = module.setEditable = function (bool) {
if (bool) {
@@ -718,6 +719,13 @@ define([
realtimeOptions.onLocal();
module.$userNameButton.click();
}
editor.focus();
if (newPad) {
cursor.setToEnd();
} else {
cursor.setToFix();
}
});
};