diff options
author | Struan Donald <struan@exo.org.uk> | 2013-03-05 16:29:09 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-03-05 16:29:09 +0000 |
commit | c1d9a61bf69db7a48ba33c95cdc0b8fc00f1755c (patch) | |
tree | 76c2ee3e47d6f5437ca2af39cdadbddd5ac5f7a0 /www/js/app.js | |
parent | 697dd86603ccfd8d8df823044d6cfc56c39872b8 (diff) |
save personal details when we submit, load them when we start and use
them in the submit form
Diffstat (limited to 'www/js/app.js')
-rw-r--r-- | www/js/app.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/www/js/app.js b/www/js/app.js index 035c0ae..54fc8b9 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -42,6 +42,7 @@ var tpl = { ], initialized: 0, + users: new FMS.Users(), currentUser: null, currentLocation: null, @@ -59,6 +60,15 @@ var tpl = { router: new FMS.appRouter() }); + // we only ever have the details of one user + FMS.users.fetch(); + if ( FMS.users.length > 0 ) { + FMS.currentUser = FMS.users.get(1); + } + if ( !FMS.currentUser ) { + FMS.currentUser = new FMS.User({id: 1}); + } + document.addEventListener('backbutton', function() { FMS.router.back(); }, true); Backbone.history.start(); |