Skip to content

Commit

Permalink
v2.7.8
Browse files Browse the repository at this point in the history
hashid can pass query params,eg, ?id=111#somePageId
  • Loading branch information
zhangxinxu committed Jul 8, 2020
1 parent d9b4afe commit 1adf553
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mobilebone.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*
* @type string
**/
Mobilebone.VERSION = "2.7.7";
Mobilebone.VERSION = "2.7.8";

/**
* Whether catch attribute of href from element with tag 'a'
Expand Down Expand Up @@ -456,10 +456,10 @@
// add on 2.4.2
var urlPush = hashid, urlPushReplace = "";

if (urlPush && /^#/.test(urlPush) == false) {
if (urlPush && /#/.test(urlPush) == false) {
urlPush = "#" + urlPush;
}
urlPushReplace = urlPush.replace(/^#/, "#&");
urlPushReplace = urlPush.replace(/#/, "#&");

if (supportHistory && this.pushStateEnabled && options.history !== false && urlPush
// hash should be different
Expand All @@ -469,7 +469,7 @@
// don't trigger 'popstate' events
history.popstate = false;
// if only pageIn, use 'replaceState'
history[pageOut? "pushState": "replaceState"](null, document.title, urlPush.replace(/^#/, "#&"));
history[pageOut ? "pushState" : "replaceState"](null, document.title, urlPush.replace(/#/, "#&"));
}

// store page-id, just once
Expand Down

0 comments on commit 1adf553

Please sign in to comment.