Skip to content

Commit 69313fb

Browse files
committed
Enhance privacy notice functionality in index.html
- Updated the privacy notice button to use an ID for easier event handling. - Added an event listener to the button to manage the display of the notice and store user consent in localStorage.
1 parent 1889c58 commit 69313fb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

worklenz-frontend/index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,16 @@
6464
notice.innerHTML = `
6565
<div style="margin-bottom: 6px; font-weight: 600; color: #fff; font-size: 1rem;">Analytics Notice</div>
6666
<div style="margin-bottom: 8px; color: #f5f5f5;">This app uses Google Analytics for anonymous usage stats. No personal data is tracked.</div>
67-
<button onclick="this.parentElement.parentElement.remove(); localStorage.setItem('privacyNoticeShown', 'true');" style="padding: 5px 14px; background: #1890ff; color: white; border: none; border-radius: 3px; cursor: pointer; font-size: 0.95rem;">Got it</button>
67+
<button id="analytics-notice-btn" style="padding: 5px 14px; background: #1890ff; color: white; border: none; border-radius: 3px; cursor: pointer; font-size: 0.95rem;">Got it</button>
6868
`;
6969
document.body.appendChild(notice);
70+
// Add event listener to button
71+
const btn = notice.querySelector('#analytics-notice-btn');
72+
btn.addEventListener('click', function(e) {
73+
e.preventDefault();
74+
localStorage.setItem('privacyNoticeShown', 'true');
75+
notice.remove();
76+
});
7077
}
7178

7279
// Wait for DOM to be ready

0 commit comments

Comments
 (0)