From 4c2a9591dcac717c2b60fedc0c6f6dda25231da2 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Wed, 27 Oct 2010 16:52:53 -0400 Subject: [PATCH] moved active class removal code into function - now called after ajax error as well as successful page change --- js/jquery.mobile.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js index 202ab442..49fdfb94 100644 --- a/js/jquery.mobile.js +++ b/js/jquery.mobile.js @@ -189,6 +189,14 @@ return wrapper; } + //remove active classes after page transition or error + function removeActiveLinkClass(){ + if(activeClickedLink){ + activeClickedLink.removeClass( activeBtnClass ); + activeClickedLink = null; + } + } + //for getting or creating a new page function changePage( to, transition, back, changeHash){ @@ -239,11 +247,7 @@ hashListener = true; }, 500); } - //remove active classes - if(activeClickedLink){ - activeClickedLink.removeClass( activeBtnClass ); - activeClickedLink = null; - } + removeActiveLinkClass(); } if(transition){ @@ -341,7 +345,7 @@ }, error: function() { pageLoading( true ); - + removeActiveLinkClass(); jQuery("

Error Loading Page

") .css({ "display": "block", "opacity": 0.96, "top": $(window).scrollTop() + 100 }) .appendTo( $pageContainer )