notebook,note, tag OK

This commit is contained in:
life
2015-01-19 00:03:46 +08:00
parent ab969d4e2c
commit 5bf1d1b5ec
11 changed files with 1054 additions and 56 deletions

9
node_modules/note.js generated vendored
View File

@@ -1,6 +1,7 @@
var db = require('db');
var User = require('user');
var Notebook = require('notebook');
var Tag = require('tag');
var Notes = db.notes;
function log(o) {
@@ -50,6 +51,10 @@ var Note = {
// 重新统计笔记本的笔记数量
Notebook.reCountNotebookNumberNotes(noteOrContent.NotebookId);
// 标签
if(noteOrContent.Tags && noteOrContent.Tags.length > 0) {
Tag.addTags(noteOrContent.Tags);
}
}
});
// 更新笔记
@@ -73,6 +78,10 @@ var Note = {
callback && callback(false);
} else {
callback && callback(noteOrContent);
// 标签
if(noteOrContent.Tags && noteOrContent.Tags.length > 0) {
Tag.addTags(noteOrContent.Tags);
}
}
});
}