mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Merge pull request #1256 from rubenvereecken/patch_fix
Patch fix: applyDelta now always called
This commit is contained in:
commit
f553a1c493
2 changed files with 6 additions and 3 deletions
|
@ -112,4 +112,4 @@ module.exports = class DeltaView extends CocoView
|
|||
delta = @model.getDelta()
|
||||
delta = deltasLib.pruneConflictsFromDelta delta, @conflicts if @conflicts
|
||||
delta = deltasLib.pruneExpandedDeltasFromDelta delta, @skippedDeltas if @skippedDeltas
|
||||
delta
|
||||
delta
|
||||
|
|
|
@ -23,8 +23,8 @@ module.exports = class PatchModal extends ModalView
|
|||
else
|
||||
@originalSource = new @targetModel.constructor({_id:targetID})
|
||||
@supermodel.loadModel @originalSource, 'source_document'
|
||||
|
||||
onLoaded: ->
|
||||
|
||||
applyDelta: ->
|
||||
@headModel = null
|
||||
if @targetModel.hasWriteAccess()
|
||||
@headModel = @originalSource.clone(false)
|
||||
|
@ -36,6 +36,9 @@ module.exports = class PatchModal extends ModalView
|
|||
@pendingModel.markToRevert true
|
||||
@deltaWorked = @pendingModel.applyDelta(@patch.get('delta'))
|
||||
@pendingModel.loaded = true
|
||||
|
||||
render: ->
|
||||
@applyDelta() if @supermodel.finished()
|
||||
super()
|
||||
|
||||
getRenderData: ->
|
||||
|
|
Loading…
Reference in a new issue