mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Cleaned up patch rendering logic
This commit is contained in:
parent
6e4170012f
commit
08030dc785
1 changed files with 1 additions and 8 deletions
|
@ -20,15 +20,9 @@ module.exports = class PatchModal extends ModalView
|
|||
targetID = @patch.get('target').id
|
||||
if targetID is @targetModel.id
|
||||
@originalSource = @targetModel.clone(false)
|
||||
@targetIsCurrent = true
|
||||
else
|
||||
@originalSource = new @targetModel.constructor({_id:targetID})
|
||||
@supermodel.loadModel @originalSource, 'source_document'
|
||||
@targetIsCurrent = false
|
||||
|
||||
onLoaded: ->
|
||||
super()
|
||||
@render()
|
||||
|
||||
applyDelta: ->
|
||||
@headModel = null
|
||||
|
@ -44,8 +38,7 @@ module.exports = class PatchModal extends ModalView
|
|||
@pendingModel.loaded = true
|
||||
|
||||
render: ->
|
||||
return @showLoading() if not (@targetIsCurrent or @supermodel.finished()) # finished() is true when no model is loaded
|
||||
@applyDelta()
|
||||
@applyDelta() if @supermodel.finished()
|
||||
super()
|
||||
|
||||
getRenderData: ->
|
||||
|
|
Loading…
Reference in a new issue