fix: enlarge ONLYOFFICE editor modal to 95vw x 85vh

This commit is contained in:
root
2026-07-16 11:07:04 +00:00
parent df08ee7879
commit 677252c807
2 changed files with 5 additions and 4 deletions

View File

@@ -661,8 +661,9 @@ function showModal(body, title, size = '') {
<h2>${title}</h2>
<button class="modal-close" onclick="closeModal()">&times;</button>
</div>` : '';
const sizeStyle = size === 'xlarge' ? 'max-width:1400px;width:95vw' : size === 'large' ? 'max-width:1000px' : '';
overlay.innerHTML = `
<div class="modal" style="${size === 'large' ? 'max-width:1000px' : ''}">
<div class="modal" style="${sizeStyle}">
${headerHTML}
<div>${body}</div>
</div>

View File

@@ -282,10 +282,10 @@ async function openOnlyofficeEditor(templateId, templateName) {
<button class="btn btn-sm btn-danger" onclick="closeOnlyofficeEditor()">Close Editor</button>
</div>
</div>
<div id="onlyoffice-editor-container" style="width:100%;height:600px;border:1px solid var(--border);border-radius:8px;overflow:hidden"></div>
<div id="onlyoffice-editor-container" style="width:100%;height:85vh;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, '', 'large');
showModal(body, '', 'xlarge');
// Load ONLYOFFICE API script dynamically
const scriptUrl = onlyofficeUrl + '/web-apps/apps/api/documents/api.js';
@@ -308,7 +308,7 @@ async function openOnlyofficeEditor(templateId, templateName) {
onlyofficeEditorInstance = new DocsAPI.DocEditor('onlyoffice-editor-container', {
...config,
width: '100%',
height: '600px',
height: '100%',
events: {
onAppReady: function() {
console.log('ONLYOFFICE editor ready');