Fix tool help modal not closable from Automations page

The close button and backdrop click handlers were only attached when
the Tools page was visited (initializeToolHelpButtons). Automation
builder '?' buttons open the same modal but the close handlers were
never set up. Added inline onclick handlers to the modal HTML and a
global Escape key listener so closing works from any page.
This commit is contained in:
Broque Thomas 2026-04-18 21:49:30 -07:00
parent 07d67e8517
commit c0c38268f5
2 changed files with 10 additions and 3 deletions

View file

@ -7705,11 +7705,11 @@
</div>
</div>
<div class="tool-help-modal" id="tool-help-modal">
<div class="tool-help-modal" id="tool-help-modal" onclick="if(event.target===this)closeToolHelpModal()">
<div class="tool-help-modal-content">
<div class="tool-help-modal-header">
<h3 id="tool-help-modal-title">Tool Information</h3>
<button class="tool-help-modal-close">&times;</button>
<button class="tool-help-modal-close" onclick="closeToolHelpModal()">&times;</button>
</div>
<div class="tool-help-modal-body" id="tool-help-modal-body">
<!-- Content will be dynamically inserted -->

View file

@ -24638,9 +24638,16 @@ function openToolHelpModal(toolId) {
function closeToolHelpModal() {
const modal = document.getElementById('tool-help-modal');
modal.classList.remove('active');
if (modal) modal.classList.remove('active');
document.body.style.overflow = ''; // Restore scrolling
}
// Global Escape key handler for tool help modal (works even if Tools page wasn't visited)
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
const modal = document.getElementById('tool-help-modal');
if (modal && modal.classList.contains('active')) closeToolHelpModal();
}
});
// ===============================
// == RETAG TOOL FUNCTIONS ==