send changes note.delete [ok]

TODO: 图片/attach的同步
This commit is contained in:
life
2015-01-27 00:14:34 +08:00
parent 218671f53a
commit 75d2710e05
5 changed files with 42 additions and 17 deletions

View File

@@ -1054,14 +1054,16 @@ Note.deleteNote = function(target, contextmenuItem, isShared) {
// 2
var note = Note.cache[noteId];
var url = "/note/deleteNote"
var serverFunc = NoteService.deleteNote;
if(note.IsTrash) {
url = "/note/deleteTrash";
serverFunc = NoteService.deleteTrash;
} else {
// 减少数量
Notebook.minusNotebookNumberNotes(note.NotebookId);
}
ajaxGet(url, {noteId: noteId, userId: note.UserId, isShared: isShared}, function(ret) {
serverFunc.call(NoteService, noteId, function(ret) {
if(ret) {
Note.changeToNext(target);