aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-07-29 19:33:41 +0100
committerStruan Donald <struan@exo.org.uk>2013-07-29 19:33:41 +0100
commitd3ccaf350fdac7f2997d7babb349543c555e90b7 (patch)
tree81718364a0ad35238b80892f1a9bd40eff28344d
parent2dfbaf0dfb44c630f2508336c78043515c1c30dd (diff)
pass in back button event from handler
This is so that the onClickButtonPrev method we eventually pass to requires an event so without having this we were breaking this and causing the back button to do nothing. Fixes #68.
-rw-r--r--src/js/app.js2
-rw-r--r--src/js/router.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/js/app.js b/src/js/app.js
index 8d28084..e463f75 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -173,7 +173,7 @@ var tpl = {
document.addEventListener('pause', function() { FMS.locator.stopTracking(); FMS.saveCurrentDraft(); }, false);
document.addEventListener('resume', onResume, false);
- document.addEventListener('backbutton', function() { FMS.router.back(); }, true);
+ document.addEventListener('backbutton', function(e) { FMS.router.back(e); }, true);
document.addEventListener('offline', function() { FMS.offline(); }, true);
document.addEventListener('online', function() { FMS.online(); }, true);
diff --git a/src/js/router.js b/src/js/router.js
index 3f5a9b2..118955e 100644
--- a/src/js/router.js
+++ b/src/js/router.js
@@ -36,9 +36,9 @@
}
},
- back: function() {
+ back: function(e) {
if (this.currentView && this.currentView.prev) {
- this.currentView.onClickButtonPrev();
+ this.currentView.onClickButtonPrev(e);
}
},