Skip to content

Commit 9909bb8

Browse files
authored
refactor: handle multiple navbar instances (#594)
1 parent 88e6172 commit 9909bb8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

resources/assets/js/navbar.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ const Navbar = {
6060
this.nav = nav;
6161
this.header = this.$root;
6262

63-
window.onscroll = this.onScroll.bind(this);
63+
window.addEventListener("scroll", () => {
64+
this.onScroll();
65+
});
66+
6467
this.scrollProgress = this.getScrollProgress();
6568

6669
this.updateStyles(this.scrollProgress);

0 commit comments

Comments
 (0)