Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rename loader -> initial_html
  • Loading branch information
Archmonger committed Nov 17, 2021
commit 5b2cc5cc293d4b86b1d7af290154105794108df2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ In context this will look a bit like the following...
</html>
```

Keyworded parameters that can also be passed in include `class="example"` and `loader="example.html"`
Keyworded parameters that can also be passed in include `class="example"` and `initial_html="example.html"`

## `example_app/views.py`

Expand Down
2 changes: 1 addition & 1 deletion src/django_idom/templates/idom/component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load static %}
<div id="{{ idom_mount_uuid }}" class="{{ class }}">{% if loader %}{% include loader %}{% endif %}</div>
<div id="{{ idom_mount_uuid }}" class="{{ class }}">{% if initial_html %}{% include initial_html %}{% endif %}</div>
<script type="module" crossorigin="anonymous">
import { mountViewToElement } from "{% static 'js/django-idom-client.js' %}";
const mountPoint = document.getElementById("{{ idom_mount_uuid }}");
Expand Down
4 changes: 2 additions & 2 deletions src/django_idom/templatetags/idom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def idom_component(_component_id_, **kwargs):
_register_component(_component_id_)

class_ = kwargs.pop("class", "")
loader = kwargs.pop("loader", "")
initial_html = kwargs.pop("initial_html", "")
json_kwargs = json.dumps(kwargs, separators=(",", ":"))

return {
"class": class_,
"loader": loader,
"initial_html": initial_html,
"idom_websocket_url": IDOM_WEBSOCKET_URL,
"idom_web_modules_url": IDOM_WEB_MODULES_URL,
"idom_ws_max_reconnect_delay": IDOM_WS_MAX_RECONNECT_DELAY,
Expand Down