From 854960162f78498afa960bd4327d0b18017e96cc Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Wed, 12 Feb 2025 18:59:11 +0000 Subject: [PATCH] templates: grants_table_scripts: Use the existing property for if widget The template is loaded with "with widget=true/false" when it is in widget mode so we can use this value as the SSOT. --- .../frontend/templates/components/grants_table_scripts.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grantnav/frontend/templates/components/grants_table_scripts.html b/grantnav/frontend/templates/components/grants_table_scripts.html index 06361b62..fb87d567 100644 --- a/grantnav/frontend/templates/components/grants_table_scripts.html +++ b/grantnav/frontend/templates/components/grants_table_scripts.html @@ -3,6 +3,7 @@ @@ -33,7 +34,7 @@ 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 = {% if widget %}true{% else %}false{% endif %}; // eslint-disable-line // We always want amount and date shown in the datatable inputColumns.push('amount');