summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/cakeside.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/cakeside.js.coffee')
-rw-r--r--app/assets/javascripts/cakeside.js.coffee35
1 files changed, 6 insertions, 29 deletions
diff --git a/app/assets/javascripts/cakeside.js.coffee b/app/assets/javascripts/cakeside.js.coffee
index c4066663..dfaa97f2 100644
--- a/app/assets/javascripts/cakeside.js.coffee
+++ b/app/assets/javascripts/cakeside.js.coffee
@@ -21,36 +21,13 @@ window.csx =
xhr.setRequestHeader "Authorization", "Token token=#{data.access_token}"
csx.Application = new Marionette.Application()
- csx.Application.addRegions
- content_region: '#backbone-content'
-
+ csx.Application.addRegions(content_region: '#backbone-content')
csx.Application.addInitializer (options) ->
- new csx.Routers.CakesRouter
- controller: new csx.Controllers.My.CakesController()
- new csx.Routers.TutorialsRouter
- controller: new csx.Controllers.My.TutorialsController()
- new csx.Routers.DashboardRouter
- controller: new csx.Controllers.My.DashboardController()
- new csx.Routers.ProfileRouter
- controller: new csx.Controllers.My.ProfileController()
-
+ new csx.Routers.CakesRouter(controller: new csx.Controllers.My.CakesController())
+ new csx.Routers.TutorialsRouter(controller: new csx.Controllers.My.TutorialsController())
+ new csx.Routers.DashboardRouter(controller: new csx.Controllers.My.DashboardController())
+ new csx.Routers.ProfileRouter(controller: new csx.Controllers.My.ProfileController())
csx.Application.on 'start', ->
if Backbone.history
Backbone.history.start()
-
- @cakes = new csx.Collections.CakesCollection()
-
- csx.Application.reqres.setHandler 'CakesRepository', =>
- @cakes
- @photos_cache = {}
- csx.Application.reqres.setHandler 'PhotosRepository', (cake_id) =>
- if @photos_cache[cake_id]
- @photos_cache[cake_id]
- else
- photos = new csx.Collections.PhotosCollection(cake_id: cake_id)
- @photos_cache[cake_id] = photos
- photos.fetch(reset: true)
- photos
-
- @cakes.fetch(reset: true).done ->
- csx.Application.start()
+ csx.Application.start()