diff --git a/backend/experiment/static/block_admin.js b/backend/experiment/static/block_admin.js index 9fa00f9df..77a5c1d50 100644 --- a/backend/experiment/static/block_admin.js +++ b/backend/experiment/static/block_admin.js @@ -1,8 +1,6 @@ document.addEventListener("DOMContentLoaded", (event) => { - fixHeadings(); - // Get experiment id from URL match = window.location.href.match(/\/experiment\/block\/(.+)\/change/); experiment_id = match && match[1]; @@ -46,30 +44,3 @@ document.addEventListener("DOMContentLoaded", (event) => { } } }) - -/** Function to fix the headings for tabular inline forms - * @todo TODO: Remove this `fixHeadings` function once the issue with headings is fixed in `django-nested-admin`. - * - https://github.com/theatlantic/django-nested-admin/issues/261 - * - https://github.com/theatlantic/django-nested-admin/pull/259 - */ -function fixHeadings() { - // Find the h2 element - const h2Elements = document.querySelectorAll('.tabular h2.inline-heading'); - - for (const h2Element of h2Elements) { - - // Get the next sibling node (which should be the text node) - const textNode = h2Element.nextSibling; - - console.log(h2Element, textNode); - - // Check if the next sibling is a text node and contains non-whitespace content - if (textNode && textNode.nodeType === Node.TEXT_NODE && textNode.textContent.trim()) { - // Move the text content into the h2 element - h2Element.textContent = textNode.textContent.trim() + h2Element.textContent; - - // Remove the original text node - textNode.remove(); - } - } -} diff --git a/backend/requirements.in/base.txt b/backend/requirements.in/base.txt index 7a9ed9617..43df93a22 100644 --- a/backend/requirements.in/base.txt +++ b/backend/requirements.in/base.txt @@ -35,4 +35,4 @@ genbadge[coverage] django-markup[all_filter_dependencies] # Nested inline forms -django-nested-admin +django-nested-admin>=4.1.1 diff --git a/backend/requirements/dev.txt b/backend/requirements/dev.txt index d3c5fb2e0..59be0ab8f 100644 --- a/backend/requirements/dev.txt +++ b/backend/requirements/dev.txt @@ -45,7 +45,7 @@ django-inline-actions==2.4.0 # via -r requirements.in/base.txt django-markup[all-filter-dependencies,all_filter_dependencies]==1.8.1 # via -r requirements.in/base.txt -django-nested-admin==4.1.0 +django-nested-admin==4.1.1 # via -r requirements.in/base.txt docutils==0.20.1 # via diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index a9c1eae56..6ad40ddba 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -34,7 +34,7 @@ django-inline-actions==2.4.0 # via -r requirements.in/base.txt django-markup[all-filter-dependencies,all_filter_dependencies]==1.8.1 # via -r requirements.in/base.txt -django-nested-admin==4.1.0 +django-nested-admin==4.1.1 # via -r requirements.in/base.txt docutils==0.20.1 # via