diff options
author | Struan Donald <struan@exo.org.uk> | 2013-08-12 17:39:54 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-08-12 17:39:54 +0100 |
commit | f36dd65f877f938a83c6124df856e0429e46982c (patch) | |
tree | a669974889e8a83b3b1c00b3a7c4f45684158ee3 /src/js/app.js | |
parent | afba393010b7a2ae4317f6197400ca43d086e7c6 (diff) |
Display help the first time the app is run
Also record when help has been viewed so we don't display it again.
For #92.
Diffstat (limited to 'src/js/app.js')
-rw-r--r-- | src/js/app.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/js/app.js b/src/js/app.js index 596b6ff..419b46a 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -41,6 +41,7 @@ var tpl = { 'home', 'around', 'offline', 'save_offline', 'reports', 'login', 'address_search', 'existing', 'photo', 'details', 'details_extra', 'submit', 'submit_email', 'submit_name', 'submit_set_password', 'submit_password', 'submit_confirm', 'sent' ], + usedBefore: 0, isLoggedIn: 0, isOffline: 0, initialized: 0, @@ -176,6 +177,11 @@ var tpl = { help.animate({left: viewWidth}, 400, 'swing', function() { $('#display-help').show(); } ); }, + helpViewed: function() { + FMS.usedBefore = 1; + localStorage.usedBefore = 1; + }, + initialize: function () { if ( this.initialized == 1 ) { return this; @@ -212,6 +218,10 @@ var tpl = { FMS.currentUser = new FMS.User({id: 1}); } + if ( localStorage.usedBefore ) { + FMS.usedBefore = 1; + } + document.addEventListener('pause', function() { FMS.locator.stopTracking(); FMS.saveCurrentDraft(); }, false); document.addEventListener('resume', onResume, false); document.addEventListener('backbutton', function(e) { FMS.router.back(e); }, true); |