refactor: remove redundant Edit Trackers button from hamburger menu
Remove duplicate "Edit Trackers" button from hamburger menu since there's
already a Tracker Settings button in the dashboard header.
Changes:
- Removed "Edit Trackers" button from template.html hamburger menu
- Updated Settings button to full width (removed .rpg-btn-half class)
- Changed dashboard button ID from 'rpg-dashboard-tracker-settings' to
'rpg-open-tracker-editor' to become the canonical button
- Removed redundant event handler in dashboardIntegration.js that was
clicking the old hamburger button
Benefits:
- Reduces UI clutter in hamburger menu
- Single source of truth for Tracker Settings button (dashboard header)
- Existing code in trackerEditor.js, infoBoxWidgets.js continues to work
via jQuery event delegation on ID 'rpg-open-tracker-editor'
Technical Notes:
- jQuery delegation $(document).on('click', '#rpg-open-tracker-editor', ...)
works for any element with that ID, not just a specific one
- No changes needed to trackerEditor.js or widget disabled state handlers
- Dashboard button is now the canonical "Edit Trackers" trigger
Related: Hamburger menu UI, dashboard header controls
This commit is contained in:
@@ -347,20 +347,8 @@ function setupDashboardEventListeners(dependencies) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tracker Settings button (open tracker editor modal)
|
// Tracker Settings button now uses ID 'rpg-open-tracker-editor'
|
||||||
const trackerSettingsBtn = document.querySelector('#rpg-dashboard-tracker-settings');
|
// Event handler is in trackerEditor.js using jQuery delegation
|
||||||
if (trackerSettingsBtn) {
|
|
||||||
trackerSettingsBtn.addEventListener('click', () => {
|
|
||||||
console.log('[RPG Companion] Tracker Settings button clicked');
|
|
||||||
// Trigger the tracker editor button from main UI
|
|
||||||
const trackerEditorBtn = document.getElementById('rpg-open-tracker-editor');
|
|
||||||
if (trackerEditorBtn) {
|
|
||||||
trackerEditorBtn.click();
|
|
||||||
} else {
|
|
||||||
console.warn('[RPG Companion] Tracker editor button not found');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Done button (exit edit mode)
|
// Done button (exit edit mode)
|
||||||
const doneBtn = document.querySelector('#rpg-dashboard-done-edit');
|
const doneBtn = document.querySelector('#rpg-dashboard-done-edit');
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<i class="fa-solid fa-pen-to-square"></i>
|
<i class="fa-solid fa-pen-to-square"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button id="rpg-dashboard-tracker-settings" class="rpg-dashboard-btn rpg-tracker-settings-btn rpg-priority-btn" title="Tracker Settings - Customize fields, names, and AI instructions" aria-label="Tracker settings">
|
<button id="rpg-open-tracker-editor" class="rpg-dashboard-btn rpg-tracker-settings-btn rpg-priority-btn" title="Tracker Settings - Customize fields, names, and AI instructions" aria-label="Tracker settings">
|
||||||
<i class="fa-solid fa-sliders"></i>
|
<i class="fa-solid fa-sliders"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
+2
-5
@@ -64,12 +64,9 @@
|
|||||||
<i class="fa-solid fa-sync"></i> Refresh RPG Info
|
<i class="fa-solid fa-sync"></i> Refresh RPG Info
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- Settings and Edit Trackers Buttons Row -->
|
<!-- Settings Button -->
|
||||||
<div class="rpg-settings-buttons-row">
|
<div class="rpg-settings-buttons-row">
|
||||||
<button id="rpg-open-tracker-editor" class="rpg-btn-settings rpg-btn-half">
|
<button id="rpg-open-settings" class="rpg-btn-settings">
|
||||||
<i class="fa-solid fa-sliders"></i> Edit Trackers
|
|
||||||
</button>
|
|
||||||
<button id="rpg-open-settings" class="rpg-btn-settings rpg-btn-half">
|
|
||||||
<i class="fa-solid fa-gear"></i> Settings
|
<i class="fa-solid fa-gear"></i> Settings
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user