Commit fbc0ea18 authored by Sven Franck's avatar Sven Franck

fixing same page transitions with ?search=parameter

parent 682b3a8e
......@@ -4744,7 +4744,7 @@ $.widget( "mobile.page", {
// TODO: calling isFirstPageUrl a lot here.
if ( content.length > 0 &&
path.isFirstPageUrl(fileUrl) ) {
settings.isFirst = true;
settings.isFirstPage = true;
}
// Reset base to the default document base
......@@ -4921,7 +4921,7 @@ $.widget( "mobile.page", {
// store the original absolute url so that it can be provided
// to events in the triggerData of the subsequent changePage call
options.absUrl = options.isFirst ? url : triggerData.absUrl;
options.absUrl = options.isFirstPage ? url : triggerData.absUrl;
this.transition( content, triggerData, options );
}, this));
......@@ -5047,7 +5047,7 @@ $.widget( "mobile.page", {
// us to avoid generating a document url with an id hash in the case where the
// first-page of the document has an id attribute specified.
if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) {
settings.dataUrl = settings.isFirst ? settings.absUrl : documentUrl.hrefNoHash;
settings.dataUrl = settings.isFirstPage ? settings.absUrl : documentUrl.hrefNoHash;
}
// The caller passed us a real page DOM element. Update our
......@@ -5076,7 +5076,7 @@ $.widget( "mobile.page", {
// It is up to the developer that turns on the allowSamePageTransitiona option
// to either turn off transition animations, or make sure that an appropriate
// animation transition is used.
if ( fromPage && fromPage[0] === toPage[0] && !settings.allowSamePageTransition ) {
if ( fromPage && fromPage[0] === toPage[0] && !settings.allowSamePageTransition && !settings.isFirstPage ) {
isPageTransitioning = false;
this._triggerWithDeprecated( "transition", triggerData );
this.element.trigger( "pagechange", triggerData );
......@@ -5847,13 +5847,16 @@ $.widget( "mobile.page", {
});
},
isSame: function() {
return this.$to[0] === this.$from[0];
isSamePage: function() {
// not sure about comparing ids
return this.$from !== undefined &&
( this.$to[0] === this.$from[0] ||
this.$to.attr( "id" ) === this.$from.attr( "id" ) )
},
cleanFrom: function( keepActive ) {
cleanFrom: function() {
this.$from
.removeClass( ( keepActive ? "" : $.mobile.activePageClass ) + " out in reverse " + this.name )
.removeClass( ( this.isSamePage() ? "" : $.mobile.activePageClass ) + " out in reverse " + this.name )
.height( "" );
},
......@@ -5986,7 +5989,7 @@ $.widget( "mobile.page", {
beforeDoneOut: function() {
if ( this.$from ) {
this.cleanFrom( this.isSame );
this.cleanFrom();
}
},
......@@ -6011,7 +6014,7 @@ $.widget( "mobile.page", {
beforeDoneIn: function() {
if ( this.$from ) {
this.cleanFrom( this.isSame );
this.cleanFrom();
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment