1
0
mirror of https://github.com/moparisthebest/app-UI synced 2024-12-21 23:18:52 -05:00

fixed bug where scroll wasn't being disabled by "scroll" attribute of view descriptor, fixed bug where event listeners were being lost on child views

This commit is contained in:
Andrew Trice 2012-05-07 21:49:16 -04:00
parent 245614ed32
commit db4d649907
3 changed files with 7 additions and 3 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
src/.DS_Store

View File

@ -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();
}
}
}