From 6a77270e5b00550443eabc759646f711d9f668d9 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Sat, 30 Mar 2024 18:43:38 +0100 Subject: [PATCH] fix: pass correct editor to pre-submit check --- static/scripts/components/editor/script.ts | 10 ++++++++-- templates/stack/new-form.html | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/static/scripts/components/editor/script.ts b/static/scripts/components/editor/script.ts index 169a93f..70c6842 100644 --- a/static/scripts/components/editor/script.ts +++ b/static/scripts/components/editor/script.ts @@ -53,7 +53,6 @@ class EditorTab extends HTMLElement { } customElements.define("file-editor-tab", EditorTab); - class Editor extends HTMLElement { private editor: AceAjax.Editor; private tabEl: HTMLDivElement; @@ -129,6 +128,14 @@ class Editor extends HTMLElement { }); } + removeFile(name: string) { + //TODO + } + + renameFile(name: string, newName: string) { + + } + setCurrent(name: string) { this.editor.setSession(this.sessions[name]); this.tabEl.querySelectorAll("file-editor-tab").forEach(el => { @@ -154,7 +161,6 @@ class Editor extends HTMLElement { return tab; } - #createNewTab() { this.addFile(`untitled${Object.keys(this.sessions).filter(s => s.startsWith("untitled")).length + 1}`, "", false); } diff --git a/templates/stack/new-form.html b/templates/stack/new-form.html index fb58376..ac94d72 100644 --- a/templates/stack/new-form.html +++ b/templates/stack/new-form.html @@ -35,7 +35,7 @@ /* Enforce check pre-submit */ const form = document.getElementById("editor-form"); - add_check(form, editor); + add_check(form, editor.editor); {% endblock %} \ No newline at end of file