mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
0fb5b1c2ea
3 changed files with 11 additions and 8 deletions
7
app/collections/ComponentsCollection.coffee
Normal file
7
app/collections/ComponentsCollection.coffee
Normal file
|
@ -0,0 +1,7 @@
|
|||
LevelComponent = require 'models/LevelComponent'
|
||||
CocoCollection = require 'models/CocoCollection'
|
||||
|
||||
module.exports = class ComponentsCollection extends CocoCollection
|
||||
url: '/db/level_component/search'
|
||||
model: LevelComponent
|
||||
|
|
@ -2,8 +2,8 @@ VersionsView = require 'views/kinds/VersionsView'
|
|||
|
||||
module.exports = class SuperVersionsView extends VersionsView
|
||||
id: "editor-component-versions-view"
|
||||
url: "/db/component/"
|
||||
url: "/db/level.component/"
|
||||
page: "component"
|
||||
|
||||
constructor: (options, @ID) ->
|
||||
super options, ID, require 'models/Component'
|
||||
super options, ID, require 'models/LevelComponent'
|
|
@ -3,13 +3,9 @@ template = require 'templates/editor/components/main'
|
|||
|
||||
Level = require 'models/Level'
|
||||
LevelComponent = require 'models/LevelComponent'
|
||||
CocoCollection = require 'models/CocoCollection'
|
||||
ComponentsCollection = require 'collections/ComponentsCollection'
|
||||
ComponentConfigView = require './config'
|
||||
|
||||
class ComponentsSearchCollection extends CocoCollection
|
||||
url: '/db/level_component/search'
|
||||
model: LevelComponent
|
||||
|
||||
module.exports = class ThangComponentEditView extends CocoView
|
||||
id: "thang-components-edit-view"
|
||||
template: template
|
||||
|
@ -25,7 +21,7 @@ module.exports = class ThangComponentEditView extends CocoView
|
|||
for model in [Level, LevelComponent]
|
||||
(new model()).on 'schema-loaded', @render unless model.schema?.loaded
|
||||
if not @componentCollection
|
||||
@componentCollection = @supermodel.getCollection new ComponentsSearchCollection()
|
||||
@componentCollection = @supermodel.getCollection new ComponentsCollection()
|
||||
unless @componentCollection.loaded
|
||||
@componentCollection.once 'sync', @onComponentsSync
|
||||
@componentCollection.fetch()
|
||||
|
|
Loading…
Reference in a new issue