mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -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
|
@ -24,7 +24,7 @@ module.exports = class PatchModal extends ModalView
|
|||
@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