Fix duplicate variable declarations in setupEventListeners
Remove duplicate button handler declarations for removeBtn, favoriteBtn, etc. The duplicate declarations were causing SyntaxError about 'removeBtn' already declared
This commit is contained in:
@ -403,24 +403,13 @@ function setupEventListeners() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove button
|
||||
const removeBtn = e.target.closest('.indicator-btn.remove');
|
||||
if (removeBtn) {
|
||||
// Visibility button (eye)
|
||||
const visibleBtn = e.target.closest('.indicator-btn.visible');
|
||||
if (visibleBtn) {
|
||||
e.stopPropagation();
|
||||
const id = removeBtn.dataset.id;
|
||||
if (id && window.removeIndicatorById) {
|
||||
window.removeIndicatorById(id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Favorite button
|
||||
const favoriteBtn = e.target.closest('.indicator-btn.favorite');
|
||||
if (favoriteBtn) {
|
||||
e.stopPropagation();
|
||||
const type = favoriteBtn.dataset.type;
|
||||
if (type && window.toggleFavorite) {
|
||||
window.toggleFavorite(type);
|
||||
const id = visibleBtn.dataset.id;
|
||||
if (id && window.toggleIndicatorVisibility) {
|
||||
window.toggleIndicatorVisibility(id);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user