fix: add missing toggleUncloseaiEmbeddedModal function for floating button
- Add toggleUncloseaiEmbeddedModal function that was missing after refactoring - Function properly toggles modal open/close state - Export function globally for floating button onclick handler - This fixes the floating button not appearing/working issue
This commit is contained in:
parent
76d0fb448a
commit
86718974ac
1 changed files with 18 additions and 0 deletions
18
src/ui.js
18
src/ui.js
|
|
@ -527,6 +527,24 @@ export function initializeSystem() {
|
|||
initializeUncloseaiElements();
|
||||
}
|
||||
|
||||
// Toggle function for floating button
|
||||
export async function toggleUncloseaiEmbeddedModal() {
|
||||
console.log("toggleUncloseaiEmbeddedModal called");
|
||||
|
||||
// Check if modal is already open
|
||||
const existingModal = document.getElementById("uncloseai-embedded-modal");
|
||||
if (existingModal && window.uncloseaiEmbeddedModalOpen) {
|
||||
console.log("Modal is open, closing it");
|
||||
existingModal.close();
|
||||
document.body.removeChild(existingModal);
|
||||
window.uncloseaiEmbeddedModalOpen = false;
|
||||
} else {
|
||||
console.log("Modal is closed, opening it");
|
||||
await openUncloseaiEmbeddedModal();
|
||||
}
|
||||
}
|
||||
|
||||
// Export modal functions globally for onclick handlers
|
||||
window.openTTSModal = openTTSModal;
|
||||
window.openTranslateModal = openTranslateModal;
|
||||
window.toggleUncloseaiEmbeddedModal = toggleUncloseaiEmbeddedModal;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue