Skip to content

Commit

Permalink
1.7.0 - better query string handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewhiteley committed Sep 17, 2024
1 parent 4849723 commit c087799
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/taxi.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.modern.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.modern.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/taxi.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@unseenco/taxi",
"description": "A modern page transition library which supports routing, preloading, and additional script reloading.",
"version": "1.6.0",
"version": "1.7.0",
"license": "GPL-3.0-or-later",
"source": "src/taxi.js",
"main": "src/taxi.js",
Expand Down
2 changes: 2 additions & 0 deletions src/Core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default class Core {
raw: string;
href: string;
host: string;
search: string;
hasHash: boolean;
pathname: string;
};
Expand Down Expand Up @@ -127,6 +128,7 @@ export default class Core {
raw: string;
href: string;
host: string;
search: string;
hasHash: boolean;
pathname: string;
};
Expand Down
6 changes: 5 additions & 1 deletion src/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ export default class Core {
*/
onPopstate = () => {
// don't trigger for on-page anchors
if (window.location.pathname === this.currentLocation.pathname && !this.isPopping) {
if (
window.location.pathname === this.currentLocation.pathname
&& window.location.search === this.currentLocation.search
&& !this.isPopping
) {
return false
}

Expand Down
3 changes: 2 additions & 1 deletion src/helpers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ export function parseDom(html: string | Document): Document | any;
* Extract details from a given URL string. Assumed to be on the current TLD.
*
* @param {string} url
* @return {{raw: string, href: string, host: string, hasHash: boolean, pathname: string}}
* @return {{raw: string, href: string, host: string, search: string, hasHash: boolean, pathname: string}}
*/
export function processUrl(url: string): {
raw: string;
href: string;
host: string;
search: string;
hasHash: boolean;
pathname: string;
};
Expand Down
3 changes: 2 additions & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function parseDom(html) {
* Extract details from a given URL string. Assumed to be on the current TLD.
*
* @param {string} url
* @return {{raw: string, href: string, host: string, hasHash: boolean, pathname: string}}
* @return {{raw: string, href: string, host: string, search: string, hasHash: boolean, pathname: string}}
*/
export function processUrl(url) {
const details = new URL(url, window.location.origin)
Expand All @@ -24,6 +24,7 @@ export function processUrl(url) {
hasHash: details.hash.length > 0,
pathname: details.pathname,
host: details.host,
search: details.search,
raw: url,
href: normalized || details.href
}
Expand Down

0 comments on commit c087799

Please sign in to comment.