mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Update RangesTracker
This commit is contained in:
parent
c8a6555cb1
commit
31ae2e7124
1 changed files with 7 additions and 6 deletions
|
@ -410,14 +410,10 @@ load = (EventEmitter) ->
|
||||||
@emit "changes:moved", moved_changes
|
@emit "changes:moved", moved_changes
|
||||||
|
|
||||||
_addOp: (op, metadata) ->
|
_addOp: (op, metadata) ->
|
||||||
# Don't take a reference to the existing op since we'll modify this in place with future changes
|
|
||||||
clone_op = {}
|
|
||||||
for k,v of op
|
|
||||||
clone_op[k] = v
|
|
||||||
change = {
|
change = {
|
||||||
id: @newId()
|
id: @newId()
|
||||||
op: clone_op
|
op: @_clone(op) # Don't take a reference to the existing op since we'll modify this in place with future changes
|
||||||
metadata: metadata
|
metadata: @_clone(metadata)
|
||||||
}
|
}
|
||||||
@changes.push change
|
@changes.push change
|
||||||
|
|
||||||
|
@ -490,6 +486,11 @@ load = (EventEmitter) ->
|
||||||
previous_change = change
|
previous_change = change
|
||||||
return { moved_changes, remove_changes }
|
return { moved_changes, remove_changes }
|
||||||
|
|
||||||
|
_clone: (object) ->
|
||||||
|
clone = {}
|
||||||
|
(clone[k] = v for k,v of object)
|
||||||
|
return clone
|
||||||
|
|
||||||
if define?
|
if define?
|
||||||
define ["utils/EventEmitter"], load
|
define ["utils/EventEmitter"], load
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue