mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-18 21:30:59 +00:00
moved the setTimeout within the transition to be in the success handler of the ajax response. We now wrap the transitionPages that we call after injecting the new page into the DOM within the setTimeout which fixes the same issue but limits to pages that are injected into the DOM and makes it more clear why we have the setTimeout
This commit is contained in:
parent
179061a4c9
commit
e15ce80702
1 changed files with 6 additions and 13 deletions
|
|
@ -410,18 +410,11 @@
|
|||
|
||||
addContainerClass('ui-mobile-viewport-transitioning');
|
||||
|
||||
/* animate in / out
|
||||
* This is in a setTimeout because we were often seeing pages in not animate across but rather go straight to
|
||||
* the 'to' page. The loadComplete would still fire, so the browser thought it was applying the animation. From
|
||||
* what I could tell this was a problem with the classes not being applied yet.
|
||||
*/
|
||||
setTimeout(function() {
|
||||
if( from ){
|
||||
from.addClass( transition + " out " + ( reverse ? "reverse" : "" ) );
|
||||
}
|
||||
to.addClass( $.mobile.activePageClass + " " + transition +
|
||||
" in " + ( reverse ? "reverse" : "" ) );
|
||||
} , 0);
|
||||
if( from ){
|
||||
from.addClass( transition + " out " + ( reverse ? "reverse" : "" ) );
|
||||
}
|
||||
to.addClass( $.mobile.activePageClass + " " + transition +
|
||||
" in " + ( reverse ? "reverse" : "" ) );
|
||||
|
||||
// callback - remove classes, etc
|
||||
to.animationComplete(function() {
|
||||
|
|
@ -541,7 +534,7 @@
|
|||
.appendTo( $.mobile.pageContainer );
|
||||
|
||||
enhancePage();
|
||||
transitionPages();
|
||||
setTimeout(function() { transitionPages() }, 0);
|
||||
},
|
||||
error: function() {
|
||||
$.mobile.pageLoading( true );
|
||||
|
|
|
|||
Loading…
Reference in a new issue