mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
27 lines
561 B
CoffeeScript
27 lines
561 B
CoffeeScript
|
define [
|
||
|
"track-changes/models/Change"
|
||
|
"libs/backbone"
|
||
|
], (Change)->
|
||
|
ChangeList = Backbone.Collection.extend
|
||
|
model: Change
|
||
|
batchSize: 3
|
||
|
|
||
|
initialize: (models, @options) ->
|
||
|
console.log arguments
|
||
|
|
||
|
url: () ->
|
||
|
url = "/project/#{@options.project_id}/doc/#{@options.doc_id}/updates?limit=#{@batchSize}"
|
||
|
if @models.length > 0
|
||
|
last = @models[@models.length - 1]
|
||
|
url += "&to=#{last.get("start_ts") - 1}"
|
||
|
return url
|
||
|
|
||
|
parse: (json) ->
|
||
|
return json.updates
|
||
|
|
||
|
fetchNextBatch: (options = {}) ->
|
||
|
options.add = true
|
||
|
@fetch options
|
||
|
|
||
|
|