fix(forge): quitter le plein ecran avant d'ouvrir l'assistant IA (BUG-056)
This commit is contained in:
@@ -1200,9 +1200,23 @@ body { font-family: var(--sans); background: var(--bg); color: var(--text); heig
|
||||
// iframe, so the AI button simply asks the parent to open it — no duplicated
|
||||
// panel, and the configured provider/model is shared automatically.
|
||||
function openAssistant() {
|
||||
try {
|
||||
window.parent.postMessage({ type: 'forge-open-ai' }, '*');
|
||||
} catch (e) { /* not embedded */ }
|
||||
var notify = function() {
|
||||
try {
|
||||
window.parent.postMessage({ type: 'forge-open-ai' }, '*');
|
||||
} catch (e) { /* not embedded */ }
|
||||
};
|
||||
// The shared assistant lives in the parent document, which cannot render
|
||||
// above a fullscreen Forge iframe: leave fullscreen first so the panel is
|
||||
// actually visible when it opens.
|
||||
if (document.fullscreenElement && document.exitFullscreen) {
|
||||
try {
|
||||
var p = document.exitFullscreen();
|
||||
if (p && p.then) p.then(notify, notify);
|
||||
else notify();
|
||||
} catch (e) { notify(); }
|
||||
} else {
|
||||
notify();
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Fullscreen (#101) ----
|
||||
|
||||
Reference in New Issue
Block a user