-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.js
More file actions
27 lines (21 loc) · 905 Bytes
/
Copy pathpopup.js
File metadata and controls
27 lines (21 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Popup script for handling UI interactions
document.addEventListener('DOMContentLoaded', function() {
const toast = document.getElementById('toast');
const actionBtn = document.getElementById('actionBtn');
const helpIcon = document.getElementById('helpIcon');
const helpContent = document.getElementById('helpContent');
// Help icon click handler
helpIcon.addEventListener('click', function() {
helpContent.classList.toggle('show');
});
// Hide help content when clicking outside
document.addEventListener('click', function(event) {
if (!helpIcon.contains(event.target) && !helpContent.contains(event.target)) {
helpContent.classList.remove('show');
}
});
// Action button click handler - Go to Trae usage page
actionBtn.addEventListener('click', function() {
chrome.tabs.create({ url: 'https://www.trae.ai/account-setting#usage' });
});
});