Skip to content

Commit dd3bc18

Browse files
authored
Fix variable scope (#2)
* Fix variable scope * Update __init__.py
1 parent c2e73a4 commit dd3bc18

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

django_admin_json_editor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .admin import JSONEditorWidget # noqa
22

3-
__version__ = '0.2.9'
3+
__version__ = '0.2.10'

django_admin_json_editor/templates/django_admin_json_editor/editor.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<div id="{{ name }}_editor"></div>
44

55
<script>
6+
var {{ js_name }}_editor;
7+
var {{ js_name }}_changees = 0;
8+
69
addEventListener("DOMContentLoaded", (event) => {
710
var container = document.getElementById("{{ name }}_editor");
811
var options = {
@@ -11,10 +14,6 @@
1114
schema: {{ schema|json_dumps }}
1215
};
1316

14-
var {{ js_name }}_editor;
15-
16-
var {{ js_name }}_changees = 0;
17-
1817
function {{ js_name }}_init(container, options) {
1918
{{ js_name }}_changees = 0;
2019
JSONEditor.defaults.options = {{ default_options|json_dumps }};

0 commit comments

Comments
 (0)