fix for current page links

This commit is contained in:
John Bender 2011-04-04 23:41:05 -07:00
parent 97db437373
commit 05cc415f0c

View file

@ -727,7 +727,10 @@
hasTarget = $this.is( "[target]" ),
//if data-ajax attr is set to false, use the default behavior of a link
hasAjaxDisabled = $this.is( ":jqmData(ajax='false')" );
hasAjaxDisabled = $this.is( ":jqmData(ajax='false')" ),
//if the url matches the active page's url
isCurrentPage = path.stripHash(url) == $.mobile.activePage.jqmData("url");
//if there's a data-rel=back attr, go back in history
if( $this.is( ":jqmData(rel='back')" ) ){
@ -737,7 +740,8 @@
//prevent # urls from bubbling
//path.get() is replaced to combat abs url prefixing in IE
if( url.replace(path.get(), "") == "#" ){
//or if the link is to the current page
if( url.replace(path.get(), "") == "#" || isCurrentPage ){
//for links created purely for interaction - ignore
event.preventDefault();
return;