Permalink
Browse files

Transition: do not set page focus on inital load to prevent jumping p…

…ages when in iframes
  • Loading branch information...
arschmitz committed Aug 12, 2013
1 parent 85d3158 commit b332bcdf17c28370bce92e1f090976c615dca613
Showing with 7 additions and 5 deletions.
  1. +7 −5 js/transitions/transition.js
@@ -63,9 +63,9 @@ define( [ "jquery",
this.deferred.resolve( this.name, this.reverse, this.$to, this.$from, true );
},
doneOut: function( screenHeight, reverseClass, none ) {
doneOut: function( screenHeight, reverseClass, none, preventFocus ) {
this.beforeDoneOut();
this.startIn( screenHeight, reverseClass, none );
this.startIn( screenHeight, reverseClass, none, preventFocus );
},
hideIn: function( callback ) {
@@ -90,12 +90,14 @@ define( [ "jquery",
}, 150 );
},
startIn: function( screenHeight, reverseClass, none ) {
startIn: function( screenHeight, reverseClass, none, preventFocus ) {
this.hideIn(function() {
this.$to.addClass( $.mobile.activePageClass + this.toPreClass );
// Send focus to page as it is now display: block
$.mobile.focusPage( this.$to );
if( !preventFocus ){
$.mobile.focusPage( this.$to );
}
// Set to page height
this.$to.height( screenHeight + this.toScroll );
@@ -153,7 +155,7 @@ define( [ "jquery",
if ( this.$from && !none ) {
this.startOut( screenHeight, reverseClass, none );
} else {
this.doneOut( screenHeight, reverseClass, none );
this.doneOut( screenHeight, reverseClass, none, true );
}
return this.deferred.promise();

0 comments on commit b332bcd

Please sign in to comment.