Skip to content

Commit f640646

Browse files
Mark SchuetteScott Jehl
authored andcommitted
added the ability to use the default behavior of links with data-ajax=false
1 parent 0572757 commit f640646

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

js/jquery.mobile.navigation.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,10 @@
618618
isExternal = path.isExternal( url ) || isRelExternal && !isEmbeddedPage,
619619

620620
//if target attr is specified we mimic _blank... for now
621-
hasTarget = $this.is( "[target]" );
621+
hasTarget = $this.is( "[target]" ),
622+
623+
//if data-ajax attr is set to false, use the default behavior of a link
624+
hasAjaxDisabled = $this.is( "[data-ajax='false']" );
622625

623626
//if there's a data-rel=back attr, go back in history
624627
if( $this.is( "[data-rel='back']" ) ){
@@ -633,7 +636,7 @@
633636

634637
$activeClickedLink = $this.closest( ".ui-btn" ).addClass( $.mobile.activeBtnClass );
635638

636-
if( isExternal || hasTarget || !$.mobile.ajaxEnabled ||
639+
if( isExternal || hasAjaxDisabled || hasTarget || !$.mobile.ajaxEnabled ||
637640
// TODO: deprecated - remove at 1.0
638641
!$.mobile.ajaxLinksEnabled ){
639642
//remove active link class if external (then it won't be there if you come back)
@@ -643,6 +646,9 @@
643646
if( hasTarget ){
644647
window.open( url );
645648
}
649+
else if( hasAjaxDisabled ){
650+
return;
651+
}
646652
else{
647653
location.href = url;
648654
}

0 commit comments

Comments
 (0)