mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
This commit is contained in:
parent
26e9dc3b09
commit
692b24dde0
1 changed files with 10 additions and 2 deletions
|
@ -31,8 +31,16 @@ module.exports = class ComponentsTabView extends View
|
|||
haveThisComponent.push thang.id if haveThisComponent.length < 100 # for performance when adding many Thangs
|
||||
return if _.isEqual presentComponents, @presentComponents
|
||||
@presentComponents = presentComponents
|
||||
treemaData = _.sortBy ({original: key.split('.')[0], majorVersion: parseInt(key.split('.')[1], 10), thangs: value, count: value.length} for key, value of @presentComponents), "count"
|
||||
treemaData.reverse()
|
||||
|
||||
componentModels = @supermodel.getModels LevelComponent
|
||||
componentModelMap = {}
|
||||
componentModelMap[comp.get('original')] = comp for comp in componentModels
|
||||
components = ({original: key.split('.')[0], majorVersion: parseInt(key.split('.')[1], 10), thangs: value, count: value.length} for key, value of @presentComponents)
|
||||
treemaData = _.sortBy components, (comp) ->
|
||||
comp = componentModelMap[comp.original]
|
||||
res = [comp.get('system'), comp.get('name')]
|
||||
return res
|
||||
|
||||
treemaOptions =
|
||||
supermodel: @supermodel
|
||||
schema: {type: 'array', items: {type: 'object', format: 'level-component'}}
|
||||
|
|
Loading…
Reference in a new issue