Skip to content

Commit

Permalink
fix back-navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanBrewer317 committed Oct 21, 2024
1 parent 0068f47 commit 850a0b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [11.0.2] - 2024-10-21

### Fixed

- Back-navigation now works again.

## [11.0.1] - 2024-10-20

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "arctic"
version = "11.0.1"
version = "11.0.2"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
Expand Down
7 changes: 6 additions & 1 deletion src/arctic/build.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,16 @@ document.addEventListener('click', async function(e) {
const is_external = url.host !== window.location.host;
if (is_external) return;
event.preventDefault();
go_to(url, true);
go_to(url);
} catch {
return;
}
});
window.addEventListener('popstate', (e) => {
e.preventDefault();
const url = new URL(window.location.href);
go_to(url);
});
function find_a(target) {
if (!target || target.tagName === 'BODY') return null;
if (target.tagName === 'A') return target;
Expand Down

0 comments on commit 850a0b7

Please sign in to comment.