added an forceRemoval argument to make sure active states are removed when a page load error occurs. Fixes #364

This commit is contained in:
scottjehl 2010-11-03 12:20:25 -04:00
parent f8a0812c20
commit 4036aa97e9

View file

@ -215,8 +215,8 @@
}
//remove active classes after page transition or error
function removeActiveLinkClass(){
if(activeClickedLink && !activeClickedLink.closest( '.ui-page-active' ).length ){
function removeActiveLinkClass(forceRemoval){
if(activeClickedLink && (!activeClickedLink.closest( '.ui-page-active' ).length) || forceRemoval ){
activeClickedLink.removeClass( activeBtnClass );
}
activeClickedLink = null;
@ -387,7 +387,7 @@
},
error: function() {
pageLoading( true );
removeActiveLinkClass();
removeActiveLinkClass(true);
jQuery("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h1>Error Loading Page</h1></div>")
.css({ "display": "block", "opacity": 0.96, "top": $(window).scrollTop() + 100 })
.appendTo( $pageContainer )