aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/router.js9
-rw-r--r--www/js/views/details.js2
-rw-r--r--www/js/views/fms.js10
3 files changed, 15 insertions, 6 deletions
diff --git a/www/js/router.js b/www/js/router.js
index 0832599..f14c279 100644
--- a/www/js/router.js
+++ b/www/js/router.js
@@ -2,6 +2,7 @@
_.extend(FMS, {
appRouter: Backbone.Router.extend({
currentView: null,
+ reverse: false,
routes: {
'': 'home',
@@ -38,6 +39,10 @@
}
},
+ reverseTransition: function() {
+ this.reverse = true;
+ },
+
around: function(){
var aroundView = new FMS.AroundView({ model: FMS.currentDraft });
this.changeView(aroundView);
@@ -138,6 +143,10 @@
if ( !this.currentView || this.currentView.id == 'front-page' ) {
options.transition = 'none';
}
+ if ( this.reverse ) {
+ options.reverse = true;
+ }
+ this.reverse = false;
$.mobile.changePage($(view.el), options);
diff --git a/www/js/views/details.js b/www/js/views/details.js
index d67cbfb..1cd0efd 100644
--- a/www/js/views/details.js
+++ b/www/js/views/details.js
@@ -39,7 +39,7 @@
onClickButtonPrev: function() {
this.updateCurrentReport();
- this.navigate( this.prev );
+ this.navigate( this.prev, true );
},
onClickButtonNext: function() {
diff --git a/www/js/views/fms.js b/www/js/views/fms.js
index 7302c4d..dbde3e7 100644
--- a/www/js/views/fms.js
+++ b/www/js/views/fms.js
@@ -49,20 +49,20 @@
afterDisplay: function() {},
- navigate: function( route, direction ) {
- if ( !direction ) {
- direction = 'left';
+ navigate: function( route, reverse ) {
+ if ( reverse ) {
+ FMS.router.reverseTransition();
}
FMS.router.navigate( route, { trigger: true } );
},
onClickButtonPrev: function() {
- this.navigate( this.prev, 'right' );
+ this.navigate( this.prev, true );
},
onClickButtonNext: function() {
- this.navigate( this.next, 'left' );
+ this.navigate( this.next );
},
displayError: function(msg) {