mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-06-28 16:10:05 +08:00
Semi-Naive Real-Time-Editing Works (as far as I can tell). Todos= CursorLogic+AuthorSync
This commit is contained in:
+12
-7
@@ -76,15 +76,20 @@ function addNode(data, socket){
|
||||
|
||||
var now = Date.now();
|
||||
|
||||
var callback = function(err, instance, now){
|
||||
socket.emit("updateReceived", [modelJson._id ,instance, data[0]]); //(update the ID)
|
||||
socket.broadcast.emit("newNode", [ [parId,newIndex] , instance ]);
|
||||
var callback = function(err, instance, now){ Node.updateParent(parId, instance._id ,newIndex, now ); }
|
||||
|
||||
Node.addNode(modelJson.text, modelJson.children, modelJson.parents, modelJson.author._id, modelJson._id ,callback);
|
||||
|
||||
|
||||
// var callback = function(err, instance, now){
|
||||
// socket.emit("updateReceived", [modelJson._id ,instance, data[0]]); //(update the ID)
|
||||
// socket.broadcast.emit("newNode", [ [parId,newIndex] , instance ]);
|
||||
|
||||
|
||||
Node.updateParent(parId, instance._id ,newIndex, now );
|
||||
}
|
||||
// Node.updateParent(parId, instance._id ,newIndex, now );
|
||||
// }
|
||||
|
||||
// console.log("newNode");
|
||||
Node.addNode(modelJson.text, modelJson.children, modelJson.parents, modelJson.author._id ,callback);
|
||||
// // console.log("newNode");
|
||||
// Node.addNode(modelJson.text, modelJson.children, modelJson.parents, modelJson.author._id ,callback);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user