diff --git a/.DS_Store b/.DS_Store index 5008ddf..69cce95 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac015e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +src/.DS_Store diff --git a/src/viewnavigator/viewnavigator.js b/src/viewnavigator/viewnavigator.js index bc438a9..fe09548 100644 --- a/src/viewnavigator/viewnavigator.js +++ b/src/viewnavigator/viewnavigator.js @@ -229,12 +229,14 @@ ViewNavigator.prototype.updateView = function( viewDescriptor ) { ViewNavigator.prototype.resetScroller = function() { var id = this.contentViewHolder.attr( "id" ); + var currentViewDescriptor = this.history[ this.history.length-1]; if ( !this.winPhone ) { if ( this.scroller != null ) { this.scroller.destroy(); + this.scroller = null; } - if ( id && !(this.currentViewDescriptor && this.currentViewDescriptor.scroll == false)) { + if ( id && !(currentViewDescriptor && currentViewDescriptor.scroll === false)) { var self = this; setTimeout( function() { self.scroller = new iScroll( id ); }, 10 ); //this.scroller = new iScroll( id ); @@ -259,11 +261,11 @@ ViewNavigator.prototype.animationCompleteHandler = function(removalTarget, heade self.resetScroller(); if ( removalTarget ) { removalTarget.unbind( "click" ); - removalTarget.remove(); + removalTarget.detach(); } if ( headerRemovalTarget ) { headerRemovalTarget.unbind( "click" ); - headerRemovalTarget.remove(); + headerRemovalTarget.detach(); } } }