fix: hide modal header when no title for ONLYOFFICE editor
This commit is contained in:
@@ -656,12 +656,14 @@ document.getElementById('chat-input')?.addEventListener('keypress', e => {
|
||||
// ============================================================
|
||||
function showModal(body, title, size = '') {
|
||||
const overlay = document.getElementById('modal-overlay');
|
||||
overlay.innerHTML = `
|
||||
<div class="modal" style="${size === 'large' ? 'max-width:1000px' : ''}">
|
||||
const headerHTML = title ? `
|
||||
<div class="modal-header">
|
||||
<h2>${title}</h2>
|
||||
<button class="modal-close" onclick="closeModal()">×</button>
|
||||
</div>
|
||||
</div>` : '';
|
||||
overlay.innerHTML = `
|
||||
<div class="modal" style="${size === 'large' ? 'max-width:1000px' : ''}">
|
||||
${headerHTML}
|
||||
<div>${body}</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -285,7 +285,7 @@ async function openOnlyofficeEditor(templateId, templateName) {
|
||||
<div id="onlyoffice-editor-container" style="width:100%;height:600px;border:1px solid var(--border);border-radius:8px;overflow:hidden"></div>
|
||||
<p class="text-muted text-sm mt-8">Changes are saved automatically. Click "Save" to force-save, or "Close Editor" to return to the template list.</p>
|
||||
`;
|
||||
showModal(body, 'ONLYOFFICE Template Editor', 'large');
|
||||
showModal(body, '', 'large');
|
||||
|
||||
// Load ONLYOFFICE API script dynamically
|
||||
const scriptUrl = onlyofficeUrl + '/web-apps/apps/api/documents/api.js';
|
||||
|
||||
Reference in New Issue
Block a user