保存优化, 自动保存优化. 不要用isDirty, 用readOnly.

保存时如果有错误, 用try cache, 避免笔记内容更改
This commit is contained in:
life
2015-10-28 15:36:24 +08:00
parent 9f20e8801f
commit 661922a5c0
5 changed files with 100 additions and 197 deletions

8
node_modules/note.js generated vendored
View File

@@ -113,19 +113,18 @@ var Note = {
if('Content' in updates && dbNote['Content'] != updates['Content']) {
isDirty = true;
// console.error(' content not same');
// ContentIsDirty 才会发Content
updates['ContentIsDirty'] = true;
} else if('Title' in updates && dbNote['Title'] != updates['Title']) {
isDirty = true;
console.error(' title not same');
// console.error(' title not same');
} else if('Tags' in updates) {
var dbTags = dbNote['Tags'] || [];
var nowTags = updates['Tags'] || [];
if(dbTags.join(',') != nowTags.join(',')) {
isDirty = true;
console.error(' tag not same');
// console.error(' tag not same');
}
}
@@ -624,9 +623,8 @@ var Note = {
// });
} else {
me.inSyncContent[noteId] = false;
console.log('not need');
// console.log('not need');
callback && callback(note);
// Web.alertWeb("NONO");
}
}