Skip to content

Commit

Permalink
use idiomorph swapping for dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
mrf7777 committed Jan 31, 2024
1 parent 4863d74 commit 2fb74c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions furfolio/static/js/idiomorph-ext.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion furfolio/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@
</title>
<link href="{% static "/style/style.css" %}" rel="stylesheet">
<script src="{% static "/js/bootstrap.bundle.min.js" %}"></script>

<script src="{% static "/js/htmx.min.js" %}"></script>
<script src="{% static "/js/idiomorph-ext.min.js" %}"></script>
<script type="text/javascript">
// set defaults for idiomorph swapping in htmx
Idiomorph.defaults.callbacks.beforeAttributeUpdated = function(attributeName, node, mutationType) { return false; }
Idiomorph.defaults.morphStyle = "innerHTML"
</script>

{% progressive_web_app_meta %}
</head>

<body class="d-flex flex-column vh-100">
<body class="d-flex flex-column vh-100" hx-ext="morph">

{% block header %}
<div class="container-fluid">
Expand Down
3 changes: 2 additions & 1 deletion furfolio/templates/furfolio/dashboards/creator.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@

<div
hx-get="{% url "dashboard_commissions_component" %}?{% query_replace request "next" request.get_full_path %}"
hx-trigger="every 10s"
hx-trigger="every 5s"
hx-swap="morph:innerHTML"
>
{% include "./commissions_component.html" %}
</div>
Expand Down

0 comments on commit 2fb74c1

Please sign in to comment.