mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-26 10:40:44 +00:00
fix for current page links
This commit is contained in:
parent
97db437373
commit
05cc415f0c
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue