added the ability to use the default behavior of links with data-ajax=false

This commit is contained in:
Mark Schuette 2011-01-31 18:04:13 +08:00 committed by Scott Jehl
parent 0572757af3
commit f640646877

View file

@ -618,7 +618,10 @@
isExternal = path.isExternal( url ) || isRelExternal && !isEmbeddedPage,
//if target attr is specified we mimic _blank... for now
hasTarget = $this.is( "[target]" );
hasTarget = $this.is( "[target]" ),
//if data-ajax attr is set to false, use the default behavior of a link
hasAjaxDisabled = $this.is( "[data-ajax='false']" );
//if there's a data-rel=back attr, go back in history
if( $this.is( "[data-rel='back']" ) ){
@ -633,7 +636,7 @@
$activeClickedLink = $this.closest( ".ui-btn" ).addClass( $.mobile.activeBtnClass );
if( isExternal || hasTarget || !$.mobile.ajaxEnabled ||
if( isExternal || hasAjaxDisabled || hasTarget || !$.mobile.ajaxEnabled ||
// TODO: deprecated - remove at 1.0
!$.mobile.ajaxLinksEnabled ){
//remove active link class if external (then it won't be there if you come back)
@ -643,6 +646,9 @@
if( hasTarget ){
window.open( url );
}
else if( hasAjaxDisabled ){
return;
}
else{
location.href = url;
}