Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 143b2b9

Browse files
committed
merge the search params when squashing makes absolutely no sense since it ruins the new url
1 parent 611bb7d commit 143b2b9

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

js/navigation/navigate.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,21 @@ define([
6868
hash = isPath ? path.stripHash(url) : url,
6969
hashUri = path.parseUrl( hash ),
7070
resolutionUrl = isPath ? path.getLocation() : $.mobile.getDocumentUrl(),
71-
passedSearch, currentSearch, mergedSearch, preservedHash;
71+
passedSearch, preservedHash;
7272

7373
// make the hash abolute with the current href
7474
href = path.makeUrlAbsolute( hash, resolutionUrl );
7575

7676
// TODO all this crap is terrible, clean it up
7777
if ( isPath ) {
78-
passedSearch = hashUri.search;
79-
currentSearch = path.parseUrl( resolutionUrl ).search;
80-
mergedSearch = path.mergeSearch( currentSearch, passedSearch );
81-
82-
// if we get a value back from the merged serve prepend a "?"
83-
mergedSearch = mergedSearch ? "?" + mergedSearch : "";
84-
8578
// Get a hash where possible and, as long as it's not a path
8679
// preserve it on the current url
8780
preservedHash = (hashUri.hash || path.parseLocation().hash);
8881
preservedHash = path.isPath( preservedHash ) ? "" : preservedHash;
8982

9083
// reconstruct each of the pieces with the new search string and hash
9184
href = path.parseUrl( href );
92-
href = href.protocol + "//" + href.host + href.pathname + mergedSearch + preservedHash;
85+
href = href.protocol + "//" + href.host + href.pathname + hashUri.search + preservedHash;
9386
href = path.resetUIKeys( href );
9487
}
9588

@@ -290,7 +283,8 @@ define([
290283
for ( i = 0; i < length; i++ ) {
291284
entry = stack[i];
292285

293-
if ( decodeURIComponent( url ) === decodeURIComponent( entry.url ) ) {
286+
if ( decodeURIComponent(url) === decodeURIComponent(entry.url)
287+
|| decodeURIComponent(url) === decodeURIComponent(entry.hash) ) {
294288
index = i;
295289

296290
if( earlyReturn ) {

0 commit comments

Comments
 (0)