Skip to content

Commit

Permalink
templates: grants_table_scripts: Use the existing property for if widget
Browse files Browse the repository at this point in the history
The template is loaded with "with widget=true/false" when it is in
widget mode so we can use this value as the SSOT.
  • Loading branch information
michaelwood committed Feb 13, 2025
1 parent 74a217b commit 81aabb1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<style scoped>
.remove-order-button:after {
content: unset !important;
cursor: auto !important;
}
</style>

Expand All @@ -29,11 +30,13 @@
{% endif %}
</script>

{{ widget|default:False|json_script:"is-widget-status" }}

<script>
const params = new URLSearchParams(window.location.search);
const inputRows = params.get('rows');
const inputColumns = params.getAll('widgetColumn');
const isWidget = window.location.pathname.includes('widget');
const isWidget = JSON.parse(document.getElementById('is-widget-status').textContent);

// We always want amount and date shown in the datatable
inputColumns.push('amount');
Expand Down

0 comments on commit 81aabb1

Please sign in to comment.