aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/app.js')
-rw-r--r--www/js/app.js10
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();