mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-07-13 01:00:28 +08:00
about to make big changes necessary for real-time editing
This commit is contained in:
+1
-1
@@ -77,7 +77,7 @@ function addNode(data, socket){
|
||||
var now = Date.now();
|
||||
|
||||
var callback = function(err, instance, now){
|
||||
socket.emit("updateReceived", [modelJson._id ,instance, data[0]]);
|
||||
socket.emit("updateReceived", [modelJson._id ,instance, data[0]]); //(update the ID)
|
||||
socket.broadcast.emit("newNode", [ [parId,newIndex] , instance ]);
|
||||
|
||||
|
||||
|
||||
@@ -87,11 +87,14 @@ function attachLogInListeners(socket){
|
||||
|
||||
//This works for all ids except negative ids.
|
||||
socket.on("editing", function(data){ //data=[id, Author.name]
|
||||
console.log("EDITING received!");
|
||||
console.log(data);
|
||||
socket.broadcast.emit("editing", data);
|
||||
});
|
||||
|
||||
|
||||
socket.on("blurred", function(data){
|
||||
console.log("BLURRED");
|
||||
socket.broadcast.emit("blurred", data);
|
||||
|
||||
var id = data[0];
|
||||
|
||||
Reference in New Issue
Block a user