Fixed a couple bugs in custom TreemaNodes.

This commit is contained in:
Nick Winter 2014-04-08 17:13:05 -07:00
parent 8362ddc1bb
commit c226835ff2
2 changed files with 24 additions and 22 deletions

View file

@ -297,7 +297,7 @@ class LatestVersionReferenceNode extends TreemaNode
@collection.url = "#{@url}?term=#{''}&project=true" @collection.url = "#{@url}?term=#{''}&project=true"
@collection.fetch() @collection.fetch()
@listenTo(@collection, 'sync', @searchCallback) @collection.once 'sync', @searchCallback, @
searchCallback: -> searchCallback: ->
container = @getSearchResultsEl().detach().empty() container = @getSearchResultsEl().detach().empty()

View file

@ -34,7 +34,7 @@ module.exports = class SystemsTabView extends View
do (url) -> ls.url = -> url do (url) -> ls.url = -> url
continue if @supermodel.getModelByURL ls.url continue if @supermodel.getModelByURL ls.url
ls.fetch() ls.fetch()
@listenTo(ls, 'sync', @onSystemLoaded) @listenToOnce ls, 'sync', @onSystemLoaded
++@toLoad ++@toLoad
@onDefaultSystemsLoaded() unless @toLoad @onDefaultSystemsLoaded() unless @toLoad
@ -143,6 +143,8 @@ class LevelSystemNode extends TreemaObjectNode
@collection = @system?.attributes?.configSchema?.properties? @collection = @system?.attributes?.configSchema?.properties?
grabDBComponent: -> 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 = @settings.supermodel.getModelByOriginalAndMajorVersion LevelSystem, @data.original, @data.majorVersion
#@system = _.find @settings.supermodel.getModels(LevelSystem), (m) => #@system = _.find @settings.supermodel.getModels(LevelSystem), (m) =>
# m.get('original') is @data.original and m.get('version').major is @data.majorVersion # m.get('original') is @data.original and m.get('version').major is @data.majorVersion