历史记录优化, 不保存一样的历史记录. ctrl+s, ctrl+e, 切换笔记都记历史

This commit is contained in:
life
2015-12-06 14:23:25 +08:00
parent 512ec39a16
commit 796bd14d15
3 changed files with 25 additions and 30 deletions

7
node_modules/note.js generated vendored
View File

@@ -227,6 +227,13 @@ var Note = {
// 更新之
else {
var histories = history.Histories;
// 如果与前一个内容一样, 则不加入历史中
if (histories
&& histories[histories.length - 1].Content
&& histories[histories.length - 1].Content == content) {
return (callback && callback(true));
}
histories.push({Content: content, UpdatedTime: now});
// 不能多了, 多了有麻烦, 20个最多