Skip to content

Commit

Permalink
exposed $.mobile.updateHash to allow plugins to update the hash witho…
Browse files Browse the repository at this point in the history
…ut triggering hashchange (when closing a dialog from back button for instance)
  • Loading branch information
scottjehl committed Nov 10, 2010
1 parent 44d78d4 commit f03e59b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/jquery.mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@
}
}

//update hash, with or without triggering hashchange event
$.mobile.updateHash = function(url, disableListening){
if(disableListening) { hashListener = false; }
location.hash = url;
}

//wrap page and transfer data-attrs if it has an ID
function wrapNewPage( newPage ){
var copyAttrs = ['data-role', 'data-theme', 'data-fullscreen'], //TODO: more page-level attrs?
Expand Down Expand Up @@ -349,8 +355,7 @@
}
reFocus( to );
if( changeHash && url ){
hashListener = false;
location.hash = url;
$.mobile.updateHash(url, true);
}
removeActiveLinkClass();

Expand Down

0 comments on commit f03e59b

Please sign in to comment.