send changes notebook.update [ok]

This commit is contained in:
life
2015-01-25 22:42:07 +08:00
parent c764f182b0
commit 0551bc2bb5
4 changed files with 24 additions and 8 deletions

9
node_modules/notebook.js generated vendored
View File

@@ -125,6 +125,12 @@ var Notebook = {
});
},
updateNotebookTitle: function(notebookId, title, callback) {
NB.update({NotebookId: notebookId}, {$set: {Title: title, IsDirty: true, UpdatedTime: new Date()}}, function(err, n) {
callback(true);
});
},
// 修改笔记本
updateNotebook: function(notebookId, callback) {
@@ -193,7 +199,7 @@ var Notebook = {
},
// 发送changes时用 api调用
getServerNotebookIdByNotebookId: function(notebookId, callback) {
if(!serverNotebookId) {
if(!notebookId) {
return callback(false);
}
NB.findOne({NotebookId: notebookId}, function(err, notebook) {
@@ -267,6 +273,7 @@ var Notebook = {
// 更新笔记本, NoteId可能也要更改
// notebook是服务器传过来的
updateNotebookForceForSendChange: function(notebookId, notebook, callback) {
var me = this;
notebook.IsDirty = false;
notebook.LocalIsNew = false;
notebook.ServerNotebookId = notebook.NotebookId;