Skip to content

Commit

Permalink
Merge pull request #669 from ygowthamr/NewsLetterPopUpIssue
Browse files Browse the repository at this point in the history
Fix Newsletter Popup Reappearance After User Dismissal
  • Loading branch information
YadavAkhileshh authored Nov 4, 2024
2 parents 74e0d09 + 428e6ef commit d7a8f87
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ window.onload = function() {
document.getElementById('popup-nl').style.display = 'none';
});

if (localStorage.getItem("noThanksClicked") === "true") {
document.getElementById('popup-nl').style.visibility = 'hidden';
}

// // Close the pop-up when clicking outside the pop-up content
// window.addEventListener('click', function(event) {
// const popupContent = document.querySelector('.popup-content'); // Select the popup content
Expand All @@ -31,4 +35,5 @@ window.onload = function() {
document.querySelector('.no-thanks-nl').addEventListener('click', function(event) {
event.preventDefault();
document.getElementById('popup-nl').style.display = 'none';
localStorage.setItem("noThanksClicked", "true");
});

0 comments on commit d7a8f87

Please sign in to comment.