Skip to content

Commit

Permalink
add a spinner while updating the chart
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Jun 18, 2024
1 parent f37d02b commit 4288961
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ckanext/charts/assets/css/charts.css

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

Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@
user_chart_builder=user_chart_builder or false %}
</div>

<div class="charts-view--preview" id="charts-view--preview" style="min-height: 450px;"></div>
<div id="chart-indicator">
{% snippet "charts/snippets/svg/loader.svg" %}
{{ _("Updating chart...") }}
</div>

<div class="charts-view--preview" id="charts-view--preview" style="min-height: 450px;">

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<div class="tab-content" id="pills-tabContent"
hx-get="{{ h.url_for('charts_view.update_chart', resource_id=resource_id) }}" hx-trigger="load, submit, change"
hx-include="closest form" hx-target="#charts-view--preview">
hx-include="closest form" hx-target="#charts-view--preview" hx-indicator="#chart-indicator">

{% for tab in form_tabs %}
{% set tab_fields = builder.get_fields_by_tab(tab) %}
Expand Down
52 changes: 52 additions & 0 deletions ckanext/charts/templates/charts/snippets/svg/loader.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions ckanext/charts/theme/charts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
.tab-content {
display: block;
}

#chart-indicator {
display: none;
}

.htmx-request#chart-indicator{
display:inline;
}
}

.charts-filters {
Expand Down

0 comments on commit 4288961

Please sign in to comment.