Fix New Document button and make editor full-screen
Build and Push Docker Image / build-and-push (push) Successful in 35s
Build and Push Docker Image / build-and-push (push) Successful in 35s
- Replace prompt() with inline title form (button → input → Create/Cancel) - Editor view: position:fixed inset:0 z-index:200 so it covers full screen - Docs editor toolbar moved into CSS (was duplicated in styles) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
95c0da5c51
commit
9375332f6a
3 files changed
+55
-9
No files matched your search
+18
-4
@@ -2603,11 +2603,25 @@ async function openDocEditor(id, key, title) {
|
||||
}
|
||||
}
|
||||
|
||||
$('#btn-new-doc').addEventListener('click', async () => {
|
||||
const title = prompt('Document title:', 'Untitled Document');
|
||||
if (!title) return;
|
||||
$('#btn-new-doc').addEventListener('click', () => {
|
||||
$('#btn-new-doc').hidden = true;
|
||||
$('#docs-new-form').hidden = false;
|
||||
$('#docs-new-title').value = '';
|
||||
$('#docs-new-title').focus();
|
||||
});
|
||||
|
||||
$('#btn-docs-new-cancel').addEventListener('click', () => {
|
||||
$('#docs-new-form').hidden = true;
|
||||
$('#btn-new-doc').hidden = false;
|
||||
});
|
||||
|
||||
$('#docs-new-form').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const title = $('#docs-new-title').value.trim() || 'Untitled Document';
|
||||
$('#docs-new-form').hidden = true;
|
||||
$('#btn-new-doc').hidden = false;
|
||||
const { id, key } = await api('/api/docs', { method: 'POST', body: { studentId: currentStudent.id, title } });
|
||||
loadDocs();
|
||||
await loadDocs();
|
||||
openDocEditor(id, key, title);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user