From 7cbf20a71c6fd52e3cdb76797ddbc2d0ee11caa0 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 17 Feb 2020 21:02:35 +0100 Subject: [PATCH] admin: fix CodeMirror field not loading correctly --- passbook/admin/templates/generic/form.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/passbook/admin/templates/generic/form.html b/passbook/admin/templates/generic/form.html index a7a073f03..b25fe016b 100644 --- a/passbook/admin/templates/generic/form.html +++ b/passbook/admin/templates/generic/form.html @@ -47,11 +47,11 @@ lineNumbers: true, }); } - const templates = document.getElementsByName('template'); - if (templates.length > 0) { + const expressions = document.getElementsByName('expression'); + if (expressions.length > 0) { // https://github.com/codemirror/CodeMirror/issues/5092 - templates[0].removeAttribute("required"); - const templateCM = CodeMirror.fromTextArea(templates[0], { + expressions[0].removeAttribute("required"); + const expressionCM = CodeMirror.fromTextArea(expressions[0], { mode: 'jinja2', theme: 'monokai', lineNumbers: true,