diff --git a/app/collections/ComponentsCollection.coffee b/app/collections/ComponentsCollection.coffee new file mode 100644 index 000000000..d5b2d4837 --- /dev/null +++ b/app/collections/ComponentsCollection.coffee @@ -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 + diff --git a/app/views/editor/component/versions.coffee b/app/views/editor/component/versions.coffee index a0638e26e..7305c29c5 100755 --- a/app/views/editor/component/versions.coffee +++ b/app/views/editor/component/versions.coffee @@ -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' \ No newline at end of file + super options, ID, require 'models/LevelComponent' \ No newline at end of file diff --git a/app/views/editor/components/main.coffee b/app/views/editor/components/main.coffee index 94dda6cbd..87a4ed3b6 100644 --- a/app/views/editor/components/main.coffee +++ b/app/views/editor/components/main.coffee @@ -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()