Skip to content

Commit

Permalink
refactor: handle multiple navbar instances (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley authored Aug 3, 2023
1 parent 88e6172 commit 9909bb8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion resources/assets/js/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ const Navbar = {
this.nav = nav;
this.header = this.$root;

window.onscroll = this.onScroll.bind(this);
window.addEventListener("scroll", () => {
this.onScroll();
});

this.scrollProgress = this.getScrollProgress();

this.updateStyles(this.scrollProgress);
Expand Down

0 comments on commit 9909bb8

Please sign in to comment.