mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
Fixed a couple bugs in custom TreemaNodes.
This commit is contained in:
parent
8362ddc1bb
commit
c226835ff2
2 changed files with 24 additions and 22 deletions
|
@ -297,7 +297,7 @@ class LatestVersionReferenceNode extends TreemaNode
|
|||
@collection.url = "#{@url}?term=#{''}&project=true"
|
||||
|
||||
@collection.fetch()
|
||||
@listenTo(@collection, 'sync', @searchCallback)
|
||||
@collection.once 'sync', @searchCallback, @
|
||||
|
||||
searchCallback: ->
|
||||
container = @getSearchResultsEl().detach().empty()
|
||||
|
|
|
@ -34,7 +34,7 @@ module.exports = class SystemsTabView extends View
|
|||
do (url) -> ls.url = -> url
|
||||
continue if @supermodel.getModelByURL ls.url
|
||||
ls.fetch()
|
||||
@listenTo(ls, 'sync', @onSystemLoaded)
|
||||
@listenToOnce ls, 'sync', @onSystemLoaded
|
||||
++@toLoad
|
||||
@onDefaultSystemsLoaded() unless @toLoad
|
||||
|
||||
|
@ -143,6 +143,8 @@ class LevelSystemNode extends TreemaObjectNode
|
|||
@collection = @system?.attributes?.configSchema?.properties?
|
||||
|
||||
grabDBComponent: ->
|
||||
unless _.isString @data.original
|
||||
return alert('Press the "Add System" button at the bottom instead of the "+". Sorry.')
|
||||
@system = @settings.supermodel.getModelByOriginalAndMajorVersion LevelSystem, @data.original, @data.majorVersion
|
||||
#@system = _.find @settings.supermodel.getModels(LevelSystem), (m) =>
|
||||
# m.get('original') is @data.original and m.get('version').major is @data.majorVersion
|
||||
|
|
Loading…
Reference in a new issue