From 932f2502e873615fb241f7cd9e15f09a2b0a7982 Mon Sep 17 00:00:00 2001 From: Andrew Trice Date: Fri, 20 Apr 2012 11:59:44 -0400 Subject: [PATCH] bug fix --- src/viewnavigator/viewnavigator.css | 6 ++++-- src/viewnavigator/viewnavigator.js | 25 +++++++++++-------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/viewnavigator/viewnavigator.css b/src/viewnavigator/viewnavigator.css index ab07b29..585e2b2 100644 --- a/src/viewnavigator/viewnavigator.css +++ b/src/viewnavigator/viewnavigator.css @@ -61,8 +61,10 @@ body { position:absolute; top:12px; - left:0px; - right:0px; + left:0%; + right:0%; + margin-left:auto; + margin-right:auto; text-align:center; font-weight: bold; color: #FFFFFF; diff --git a/src/viewnavigator/viewnavigator.js b/src/viewnavigator/viewnavigator.js index 2f0cef0..c031197 100644 --- a/src/viewnavigator/viewnavigator.js +++ b/src/viewnavigator/viewnavigator.js @@ -69,21 +69,18 @@ ViewNavigator.prototype.pushView = function( viewDescriptor ) { ViewNavigator.prototype.popView = function() { - if ( this.history.length > 1 ) { - if (this.animating || this.history.length <= 1 ) - return; - - var currentViewDescriptor = this.history[ this.history.length-1]; - this.history.pop(); - - if ( currentViewDescriptor.backCallback ) { - currentViewDescriptor.backCallback(); - } - - var viewDescriptor = this.history[ this.history.length-1 ]; - viewDescriptor.animation = "popEffect" - this.updateView( viewDescriptor ); + if (this.animating || this.history.length <= 1 ) + return; + + var currentViewDescriptor = this.history[ this.history.length-1]; + if ( currentViewDescriptor.backCallback ) { + currentViewDescriptor.backCallback(); } + + this.history.pop(); + var viewDescriptor = this.history[ this.history.length-1 ]; + viewDescriptor.animation = "popEffect" + this.updateView( viewDescriptor ); } ViewNavigator.prototype.setHeaderPadding = function( amount ) {