From 205364620db6744367f70ea5e33c73aff353f91f Mon Sep 17 00:00:00 2001 From: wuyuntao Date: Mon, 18 Oct 2010 18:10:38 +0800 Subject: [PATCH] Modified to allow for pages to have a data-back attribute which provides a way to use backward transition manually. --- js/jquery.mobile.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js index 74fa0e80..3c9fc4b6 100644 --- a/js/jquery.mobile.js +++ b/js/jquery.mobile.js @@ -46,6 +46,7 @@ startPageId = 'ui-page-start', activePageClass = 'ui-page-active', pageTransition, + forceBack, transitions = 'slide slideup slidedown pop flip fade', transitionDuration = 350, backBtnText = "Back", @@ -102,6 +103,7 @@ jQuery.fn.ajaxClick = function() { var href = jQuery( this ).attr( "href" ); pageTransition = jQuery( this ).data( "transition" ) || "slide"; + forceBack = jQuery( this ).data( "back" ) || undefined; nextPageRole = jQuery( this ).attr( "data-rel" ); //find new base for url building @@ -223,7 +225,9 @@ transition = urlStack.pop().transition; } else { urlStack.push({ url: url, transition: transition }); + if ( forceBack ) back = true; } + forceBack = undefined; //function for setting role of next page function setPageRole( newPage ) {