Synchronized editor for multiple files
This commit is contained in:

committed by
Sebastian Serth

parent
7df37078f4
commit
23a95d315d
@ -24,12 +24,12 @@ $(document).on('turbolinks:load', function () {
|
||||
received(data) {
|
||||
// Called when there's incoming data on the websocket for this channel
|
||||
if (current_user_id !== data['current_user_id']) {
|
||||
CodeOceanEditor.applyChanges(data['delta']['data']);
|
||||
CodeOceanEditor.applyChanges(data['delta']['data'], data['active_file']);
|
||||
}
|
||||
},
|
||||
|
||||
send_changes(delta) {
|
||||
const delta_with_user_id = {current_user_id: current_user_id, delta: delta}
|
||||
send_changes(delta, active_file) {
|
||||
const delta_with_user_id = {current_user_id: current_user_id, active_file: active_file, delta: delta}
|
||||
this.perform('send_changes', {delta_with_user_id: delta_with_user_id});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user