mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Fixed the patches view.
This commit is contained in:
parent
d94856d00c
commit
8f9aea1b9b
2 changed files with 6 additions and 8 deletions
|
@ -710,3 +710,4 @@
|
|||
user_names: "User Names"
|
||||
files: "Files"
|
||||
top_simulators: "Top Simulators"
|
||||
source_document: "Source Document"
|
|
@ -17,14 +17,11 @@ module.exports = class PatchModal extends ModalView
|
|||
constructor: (@patch, @targetModel, options) ->
|
||||
super(options)
|
||||
targetID = @patch.get('target').id
|
||||
if false
|
||||
@originalSource = targetModel.clone(false)
|
||||
@onOriginalLoaded()
|
||||
if targetID is @targetModel.id
|
||||
@originalSource = @targetModel.clone(false)
|
||||
else
|
||||
@originalSource = new targetModel.constructor({_id:targetID})
|
||||
@originalSource.fetch()
|
||||
@listenToOnce @originalSource, 'sync', @onOriginalLoaded
|
||||
@addResourceToLoad(@originalSource)
|
||||
@originalSource = new @targetModel.constructor({_id:targetID})
|
||||
@supermodel.loadModel @originalSource, 'source_document'
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
|
@ -35,7 +32,7 @@ module.exports = class PatchModal extends ModalView
|
|||
c
|
||||
|
||||
afterRender: ->
|
||||
return if @originalSource.loading
|
||||
return unless @supermodel.finished()
|
||||
headModel = null
|
||||
if @targetModel.hasWriteAccess()
|
||||
headModel = @originalSource.clone(false)
|
||||
|
|
Loading…
Reference in a new issue