fix: pass correct editor to pre-submit check
This commit is contained in:
parent
6e24ffb499
commit
6a77270e5b
2 changed files with 9 additions and 3 deletions
|
@ -53,7 +53,6 @@ class EditorTab extends HTMLElement {
|
||||||
}
|
}
|
||||||
customElements.define("file-editor-tab", EditorTab);
|
customElements.define("file-editor-tab", EditorTab);
|
||||||
|
|
||||||
|
|
||||||
class Editor extends HTMLElement {
|
class Editor extends HTMLElement {
|
||||||
private editor: AceAjax.Editor;
|
private editor: AceAjax.Editor;
|
||||||
private tabEl: HTMLDivElement;
|
private tabEl: HTMLDivElement;
|
||||||
|
@ -129,6 +128,14 @@ class Editor extends HTMLElement {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removeFile(name: string) {
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
renameFile(name: string, newName: string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
setCurrent(name: string) {
|
setCurrent(name: string) {
|
||||||
this.editor.setSession(this.sessions[name]);
|
this.editor.setSession(this.sessions[name]);
|
||||||
this.tabEl.querySelectorAll<EditorTab>("file-editor-tab").forEach(el => {
|
this.tabEl.querySelectorAll<EditorTab>("file-editor-tab").forEach(el => {
|
||||||
|
@ -154,7 +161,6 @@ class Editor extends HTMLElement {
|
||||||
return tab;
|
return tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#createNewTab() {
|
#createNewTab() {
|
||||||
this.addFile(`untitled${Object.keys(this.sessions).filter(s => s.startsWith("untitled")).length + 1}`, "", false);
|
this.addFile(`untitled${Object.keys(this.sessions).filter(s => s.startsWith("untitled")).length + 1}`, "", false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
/* Enforce check pre-submit */
|
/* Enforce check pre-submit */
|
||||||
const form = document.getElementById("editor-form");
|
const form = document.getElementById("editor-form");
|
||||||
add_check(form, editor);
|
add_check(form, editor.editor);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
Reference in a new issue