Skip to content

Commit e1bf7bc

Browse files
imankulovadamghill
authored andcommitted
Use "unicorn:settings:" prefix for morpher-options
Add the namespace similarly to how it's done for "unicorn:data"
1 parent 01e4f40 commit e1bf7bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

django_unicorn/templates/unicorn/scripts.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{% load static %}
22

3-
{{ MORPHER_OPTIONS|json_script:"morpher-options" }}
3+
{{ MORPHER_OPTIONS|json_script:"unicorn:settings:morpher-options" }}
44

55
{% if MINIFIED %}
66
<script src="{% static 'unicorn/js/unicorn.min.js' %}"></script>
77
<script>
88
var url = "{% url 'django_unicorn:message' %}";
9-
var morpherOptions = JSON.parse(document.getElementById("morpher-options").textContent);
9+
var morpherOptions = JSON.parse(document.getElementById("unicorn:settings:morpher-options").textContent);
1010
var morpher = getMorpher("{{ MORPHER }}", morpherOptions);
1111
Unicorn.init(url, "{{ CSRF_HEADER_NAME }}", "{{ CSRF_COOKIE_NAME }}", morpher);
1212
</script>
@@ -18,7 +18,7 @@
1818
window.Unicorn = Unicorn;
1919

2020
var url = "{% url 'django_unicorn:message' %}";
21-
var morpherOptions = JSON.parse(document.getElementById("morpher-options").textContent);
21+
var morpherOptions = JSON.parse(document.getElementById("unicorn:settings:morpher-options").textContent);
2222
var morpher = getMorpher("{{ MORPHER }}", morpherOptions);
2323
Unicorn.init(url, "{{ CSRF_HEADER_NAME }}", "{{ CSRF_COOKIE_NAME }}", morpher);
2424
</script>

0 commit comments

Comments
 (0)