Merge pull request #1256 from rubenvereecken/patch_fix

Patch fix: applyDelta now always called
This commit is contained in:
Scott Erickson 2014-07-04 11:45:22 -07:00
commit f553a1c493
2 changed files with 6 additions and 3 deletions

View file

@ -24,7 +24,7 @@ module.exports = class PatchModal extends ModalView
@originalSource = new @targetModel.constructor({_id:targetID}) @originalSource = new @targetModel.constructor({_id:targetID})
@supermodel.loadModel @originalSource, 'source_document' @supermodel.loadModel @originalSource, 'source_document'
onLoaded: -> applyDelta: ->
@headModel = null @headModel = null
if @targetModel.hasWriteAccess() if @targetModel.hasWriteAccess()
@headModel = @originalSource.clone(false) @headModel = @originalSource.clone(false)
@ -36,6 +36,9 @@ module.exports = class PatchModal extends ModalView
@pendingModel.markToRevert true @pendingModel.markToRevert true
@deltaWorked = @pendingModel.applyDelta(@patch.get('delta')) @deltaWorked = @pendingModel.applyDelta(@patch.get('delta'))
@pendingModel.loaded = true @pendingModel.loaded = true
render: ->
@applyDelta() if @supermodel.finished()
super() super()
getRenderData: -> getRenderData: ->