https://github.com/jquery/jquery-mobile/issues#issue/493 If changePage is called with to parameter that matches the current page we simply return out of the function

This commit is contained in:
Jesse Streb 2010-12-03 17:07:39 -05:00 committed by scottjehl
parent 8118b77a6a
commit b725ff8f6a

View file

@ -146,6 +146,11 @@
duplicateCachedPage = null,
back = (back !== undefined) ? back : ( urlStack.length > 1 && urlStack[ urlStack.length - 2 ].url === url ),
transition = (transition !== undefined) ? transition : $.mobile.defaultTransition;
//If we are trying to transition to the same page that we are currently on ignore the request.
if(urlStack.length > 1 && url === urlStack[urlStack.length -1].url) {
return;
}
if( $.type(to) === "object" && to.url ){
url = to.url,