Skip to content

Commit

Permalink
WebKit compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerweb committed Dec 19, 2023
1 parent a0b0ac1 commit b00bb25
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,15 @@
if (surveyURL) window.location = surveyURL;
}

class dismisser extends HTMLButtonElement {
connectedCallback() {
// let flagName = 'test-flag';
this.addEventListener("click", () => {
splash.close();
storedInfo.status = this.getAttribute('id').replace('dismiss-','');
console.log(storedInfo);
localStorage.setItem(flagName, JSON.stringify(storedInfo));
if (storedInfo.status == "Y") surveyRedirect();
});
}
}

customElements.define("dis-misser", dismisser, {extends: "button"});

document.querySelectorAll('button[is="dis-misser"]').forEach(el => {
el.addEventListener("click", () => {
splash.close();
storedInfo.status = el.getAttribute('id').replace('dismiss-','');
console.log(storedInfo);
localStorage.setItem(flagName, JSON.stringify(storedInfo));
if (storedInfo.status == "Y") surveyRedirect();
});
});

window.onload = startup(flagName);
</script>

0 comments on commit b00bb25

Please sign in to comment.