mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Switch order of args
This commit is contained in:
parent
55c880e1dd
commit
790b9ea8ed
1 changed files with 11 additions and 14 deletions
|
@ -79,26 +79,23 @@ module.exports = Router =
|
|||
if err?
|
||||
Router._handleError null, err, client, "leaveProject"
|
||||
|
||||
# Variadic. The possible options:
|
||||
# Variadic. The possible arguments:
|
||||
# doc_id, callback
|
||||
# doc_id, fromVersion, callback
|
||||
# doc_id, options, callback
|
||||
# doc_id, options, fromVersion, callback
|
||||
client.on "joinDoc", (doc_id, options, fromVersion, callback) ->
|
||||
# options is optional
|
||||
# doc_id, fromVersion, options, callback
|
||||
client.on "joinDoc", (doc_id, fromVersion, options, callback) ->
|
||||
if typeof fromVersion == "function"
|
||||
fromVersion = -1
|
||||
options = {}
|
||||
callback = fromVersion
|
||||
else if typeof fromVersion == "object"
|
||||
fromVersion = -1
|
||||
options = fromVersion
|
||||
callback = options
|
||||
if typeof options == "function"
|
||||
options = {}
|
||||
callback = options
|
||||
fromVersion = -1
|
||||
else if typeof options == "number"
|
||||
options = {}
|
||||
fromVersion = options
|
||||
callback = fromVersion
|
||||
|
||||
# fromVersion is optional
|
||||
if typeof fromVersion == "function"
|
||||
callback = fromVersion
|
||||
fromVersion = -1
|
||||
|
||||
WebsocketController.joinDoc client, doc_id, options, fromVersion, (err, args...) ->
|
||||
if err?
|
||||
|
|
Loading…
Reference in a new issue