From b01f687cd03995481988fc2a5021f3ec28e3d33f Mon Sep 17 00:00:00 2001 From: Jerome Rasky Date: Sun, 23 Sep 2012 20:12:12 -0700 Subject: [PATCH] Made new overlay method with backbone actually work, but it's still buggy, and for some reason when there are no overlays, backbone fails to start --- .../geocamTiePoint/js/backbone/router.js | 6 ++-- .../geocamTiePoint/js/backbone/views.js | 31 +++++++++++++------ .../templates/geocamTiePoint/backbone.html | 4 +++ geocamTiePoint/views.py | 1 + 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/geocamTiePoint/static/geocamTiePoint/js/backbone/router.js b/geocamTiePoint/static/geocamTiePoint/js/backbone/router.js index 4ec635c..5d209e6 100644 --- a/geocamTiePoint/static/geocamTiePoint/js/backbone/router.js +++ b/geocamTiePoint/static/geocamTiePoint/js/backbone/router.js @@ -4,8 +4,8 @@ $(function($) { var AppRouter = Backbone.Router.extend({ routes: { 'overlays/': 'listOverlays', + 'overlays/new': 'newOverlay', 'overlay/:overlay_id': 'showOverlay', - 'overlay/new': 'newOverlay', '': 'root' }, @@ -28,7 +28,7 @@ $(function($) { newOverlay: function() { console.log('Routed to newOveraly'); - var view = new apps.views.NewOverlayView(); + var view = new app.views.NewOverlayView(); view.render(); }, @@ -38,5 +38,5 @@ $(function($) { }); app.router = new AppRouter(); - + //app.router.start(); }); diff --git a/geocamTiePoint/static/geocamTiePoint/js/backbone/views.js b/geocamTiePoint/static/geocamTiePoint/js/backbone/views.js index 820887f..2bfb1a8 100644 --- a/geocamTiePoint/static/geocamTiePoint/js/backbone/views.js +++ b/geocamTiePoint/static/geocamTiePoint/js/backbone/views.js @@ -38,7 +38,7 @@ $(function($) { app.views.ListOverlaysView = app.views.View.extend({ template: '

Choose an overlay:

' + - 'New Overlay' + + 'New Overlay' + '{{debug}}' + '