Skip to content

Commit

Permalink
Fix variable scope (#2)
Browse files Browse the repository at this point in the history
* Fix variable scope

* Update __init__.py
  • Loading branch information
unformatt authored Nov 19, 2024
1 parent c2e73a4 commit dd3bc18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion django_admin_json_editor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .admin import JSONEditorWidget # noqa

__version__ = '0.2.9'
__version__ = '0.2.10'
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<div id="{{ name }}_editor"></div>

<script>
var {{ js_name }}_editor;
var {{ js_name }}_changees = 0;

addEventListener("DOMContentLoaded", (event) => {
var container = document.getElementById("{{ name }}_editor");
var options = {
Expand All @@ -11,10 +14,6 @@
schema: {{ schema|json_dumps }}
};

var {{ js_name }}_editor;

var {{ js_name }}_changees = 0;

function {{ js_name }}_init(container, options) {
{{ js_name }}_changees = 0;
JSONEditor.defaults.options = {{ default_options|json_dumps }};
Expand Down

0 comments on commit dd3bc18

Please sign in to comment.