Not need to render at Full sync

This commit is contained in:
life
2017-01-21 11:57:39 +08:00
parent 6e4a877997
commit 85a164f7c1
2 changed files with 59 additions and 1 deletions

4
node_modules/sync.js generated vendored
View File

@@ -654,6 +654,9 @@ var Sync = {
// mainType == notebook, note, tag
// type = changeAdds, changeConflicts, adds, deletes, updates, conflicts, errors,
fixSynced: function (mainType, type, data) {
if (this.fullSyncStart) {
return;
}
var o = {};
if (!Common.isArray(data)) {
data = [data];
@@ -738,6 +741,7 @@ var Sync = {
setSyncFinished: function(hasError) {
var me = this;
me.incrSyncStart = false;
me.fullSyncStart = false;
// Web.syncProgress(0);
Web.syncFinished(hasError);
},

54
node_modules/web.js generated vendored
View File

@@ -40,26 +40,44 @@ var Web = {
},
reloadNotebook: function () {
if (SyncService.fullSyncStart) {
return;
}
this.Notebook.reload();
},
addSyncNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Notebook.addSync(notebooks);
},
updateSyncNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Notebook.updateSync(notebooks);
},
deleteSyncNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Notebook.deleteSync(notebooks);
},
addChangeNotebook: function(notebooks) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Notebook.addChanges(notebooks);
},
updateChangeNotebook: function (notebooks) {
if (SyncService.fullSyncStart) {
return;
}
this.Notebook.updateChanges(notebooks);
},
/*
@@ -71,10 +89,16 @@ var Web = {
//----------
addSyncNote: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Note.addSync(notes);
},
updateSyncNote: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Note.updateSync(notes);
},
@@ -83,22 +107,37 @@ var Web = {
me.Note.updateErrors(notes);
},
updateChangeUpdates: function (notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Note.updateChangeUpdates(notes);
},
updateChangeAdds: function (notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Note.updateChangeAdds(notes);
},
deleteSyncNote: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Note.deleteSync(notes);
},
fixSyncConflictNote: function(note, newNote) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Note.fixSyncConflict(note, newNote);
},
updateNoteCacheForServer: function(notes) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Note.updateNoteCacheForServer(notes);
},
@@ -118,6 +157,9 @@ var Web = {
//
addOrDeleteTagFromSync: function(tagSyncInfo) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
// console.log("是啊");
// console.error(tagSyncInfo);
@@ -128,12 +170,18 @@ var Web = {
},
addTag: function(tag) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Tag.addTagNav(tag);
},
// 内容同步成功
contentSynced: function(noteId, content) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
if(noteId) {
me.Note.contentSynced(noteId, content);
@@ -142,6 +190,9 @@ var Web = {
// 通过attach已同步成功
attachSynced: function(attachs, attach, noteId) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Attach.attachSynced(attachs, attach, noteId);
},
@@ -175,6 +226,9 @@ var Web = {
// 重新统计后, 显示到web上
updateNotebookNumberNotes: function(notebookId, count) {
if (SyncService.fullSyncStart) {
return;
}
var me = this;
me.Notebook && me.Notebook.updateNotebookNumberNotes(notebookId, count);
}