仅保存20条记录, ctrl+s, ctrl+e时保存历史记录. 自动保存时不添加到历史记录中

https://github.com/leanote/desktop-app/issues/70
This commit is contained in:
life
2015-11-24 10:42:00 +08:00
parent 98e0085f76
commit 0f881c8e77
5 changed files with 36 additions and 16 deletions

View File

@@ -499,7 +499,7 @@ Note.curChangedSaveIt = function(force, callback) {
}
callback && callback(ret);
});
}, force);
return hasChanged;
@@ -676,7 +676,7 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
needSaveChanged = true;
}
if(needSaveChanged) {
Note.curChangedSaveIt();
Note.curChangedSaveIt(true);
}
// 2. 设空, 防止在内容得到之前又发生保存
@@ -1095,7 +1095,7 @@ Note.newNote = function(notebookId, isShare, fromUserId, isMarkdown) {
Note.stopInterval();
// 保存当前的笔记
Note.curChangedSaveIt();
Note.curChangedSaveIt(true);
Note.batch.reset();
@@ -1789,13 +1789,12 @@ Note.toggleReadOnly = function(needSave) {
// 保存之
if (needSave) {
Note.curChangedSaveIt();
Note.curChangedSaveIt(true);
}
Note.readOnly = true;
LEA.readOnly = true;
if(!note.IsMarkdown) {
// 里面的pre也设为不可写
$('#editorContent pre').each(function() {