Permalink
Browse files

Navigation: If the default is prevented on the originalEvent of "navi…

…gate", do not go into _handleHashChange. Fixes #5775.
  • Loading branch information...
1 parent 320fbba commit c6dd725ce183c6de0f21d7b72939792e4a2ff48a @gabrielschulhof gabrielschulhof committed Mar 21, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 js/jquery.mobile.navigation.js
@@ -1345,7 +1345,13 @@ define( [
// TODO roll the logic here into the handleHashChange method
$window.bind( "navigate", function( e, data ) {
- var url = $.event.special.navigate.originalEventName.indexOf( "hashchange" ) > -1 ? data.state.hash : data.state.url;
+ var url;
+
+ if ( e.originalEvent && e.originalEvent.isDefaultPrevented() ) {
+ return;
+ }
+
+ url = $.event.special.navigate.originalEventName.indexOf( "hashchange" ) > -1 ? data.state.hash : data.state.url;
if( !url ) {
url = $.mobile.path.parseLocation().hash;

0 comments on commit c6dd725

Please sign in to comment.