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

@ -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

View file

@ -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: ->