change notebook status: dirty, new

This commit is contained in:
life
2017-01-19 14:38:18 +08:00
parent b82afa1d24
commit 8472adfe59
7 changed files with 155 additions and 133 deletions

10
node_modules/notebook.js generated vendored
View File

@@ -434,6 +434,7 @@ var Notebook = {
var me = this;
// 服务器没有, 但是是发送更新的, 所以需要作为添加
// 情况很少见
if(notebookSyncInfo.changeNeedAdds) {
var needAddNotebooks = notebookSyncInfo.changeNeedAdds;
for(var i in needAddNotebooks) {
@@ -442,6 +443,7 @@ var Notebook = {
}
}
// pull
// 处理添加的, 更新的, 这里前端统一重新渲染!!
var adds = notebookSyncInfo.adds;
if (!isEmpty(adds) || !isEmpty(notebookSyncInfo.updates)) {
@@ -452,11 +454,15 @@ var Notebook = {
Web.reloadNotebook();
}
// push
if (!isEmpty(notebookSyncInfo.changeAdds)) {
console.log(' has changeAdds notebook')
console.log(notebookSyncInfo.changeAdds)
console.log(' has changeAdds notebook', notebookSyncInfo.changeAdds);
Web.addChangeNotebook(notebookSyncInfo.changeAdds);
}
if (!isEmpty(notebookSyncInfo.changeUpdates)) {
console.log(' has changeUpdates notebook', notebookSyncInfo.changeUpdates);
Web.updateChangeNotebook(notebookSyncInfo.changeUpdates);
}
if (!isEmpty(notebookSyncInfo.deletes)) {
// 处理删除的