Skip to content

Commit

Permalink
improve sl-route in <a >
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadali-arjomand committed Sep 15, 2023
1 parent 32cac97 commit 6196f59
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/singlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class Page { // create parent class for pages
e.setAttribute("sl-goto", route) // set route to singlight goto attribute
}
e.addEventListener("click", e => {
e.preventDefault()
this.redirect(e.target.getAttribute("sl-goto"))
}) // add event listener to element to redirect when clicked
e.removeAttribute("sl-route") // remove sl-route attribute
Expand Down

0 comments on commit 6196f59

Please sign in to comment.