Skip to content

Commit

Permalink
Merge pull request #2874 from tvdeyen/fix-dialog-link-double-open
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen authored May 15, 2024
2 parents 6af974a + 16c39d1 commit 0f49374
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/javascript/alchemy_admin/components/dialog_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ export const DEFAULTS = {
}

export class DialogLink extends HTMLAnchorElement {
connectedCallback() {
this.addEventListener("click", (evt) => {
if (!this.disabled) {
this.openDialog()
}
evt.preventDefault()
})
constructor() {
super()
this.addEventListener("click", this)
}

handleEvent(evt) {
if (!this.disabled) {
this.openDialog()
}
evt.preventDefault()
}

openDialog() {
Expand Down

0 comments on commit 0f49374

Please sign in to comment.