Skip to content

Commit 1adf553

Browse files
author
zhangxinxu
committed
v2.7.8
hashid can pass query params,eg, ?id=111#somePageId
1 parent d9b4afe commit 1adf553

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mobilebone.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*
4747
* @type string
4848
**/
49-
Mobilebone.VERSION = "2.7.7";
49+
Mobilebone.VERSION = "2.7.8";
5050

5151
/**
5252
* Whether catch attribute of href from element with tag 'a'
@@ -456,10 +456,10 @@
456456
// add on 2.4.2
457457
var urlPush = hashid, urlPushReplace = "";
458458

459-
if (urlPush && /^#/.test(urlPush) == false) {
459+
if (urlPush && /#/.test(urlPush) == false) {
460460
urlPush = "#" + urlPush;
461461
}
462-
urlPushReplace = urlPush.replace(/^#/, "#&");
462+
urlPushReplace = urlPush.replace(/#/, "#&");
463463

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

475475
// store page-id, just once

0 commit comments

Comments
 (0)