Permalink
Browse files

Pagecontainer: Record allowSamePageTransition in urlHistory

Closes gh-7614
Fixes gh-7586
  • Loading branch information...
gabrielschulhof committed Jul 24, 2014
1 parent 3993257 commit 834843c5f27abb8ea152982ac10ee5704efc40b7
Showing with 13 additions and 6 deletions.
  1. +13 −6 js/widgets/pagecontainer.js
@@ -231,11 +231,16 @@ define( [
return to || this._getInitialContent();
},
_transitionFromHistory: function( direction, defaultTransition ) {
// The options by which a given page was reached are stored in the history entry for that
// page. When this function is called, history is already at the new entry. So, when moving
// back, this means we need to consult the old entry and reverse the meaning of the
// options. Otherwise, if we're moving forward, we need to consult the options for the
// current entry.
_optionFromHistory: function( direction, optionName, fallbackValue ) {
var history = this._getHistory(),
entry = ( direction === "back" ? history.getLast() : history.getActive() );
return ( entry && entry.transition ) || defaultTransition;
return ( ( entry && entry[ optionName ] ) || fallbackValue );
},
_handleDialog: function( changePageOptions, data ) {
@@ -267,8 +272,7 @@ define( [
// as most of this is lost by the domCache cleaning
$.extend( changePageOptions, {
role: active.role,
transition: this._transitionFromHistory(
data.direction,
transition: this._optionFromHistory( data.direction, "transition",
changePageOptions.transition ),
reverse: data.direction === "back"
});
@@ -285,7 +289,7 @@ define( [
// transition is false if it's the first page, undefined
// otherwise (and may be overridden by default)
transition = history.stack.length === 0 ? "none" :
this._transitionFromHistory( data.direction ),
this._optionFromHistory( data.direction, "transition" ),
// default options for the changPage calls made after examining
// the current state of the page and the hash, NOTE that the
@@ -297,7 +301,9 @@ define( [
};
$.extend( changePageOptions, data, {
transition: transition
transition: transition,
allowSamePageTransition: this._optionFromHistory( data.direction,
"allowSamePageTransition" )
});
// TODO move to _handleDestination ?
@@ -1117,6 +1123,7 @@ define( [
// TODO the property names here are just silly
params = {
allowSamePageTransition: settings.allowSamePageTransition,
transition: settings.transition,
title: pageTitle,
pageUrl: pageUrl,

0 comments on commit 834843c

Please sign in to comment.