diff --git a/anatomy/templates/anatomy/question_detail.html b/anatomy/templates/anatomy/question_detail.html
index 9fb171ce..7d504c1c 100644
--- a/anatomy/templates/anatomy/question_detail.html
+++ b/anatomy/templates/anatomy/question_detail.html
@@ -49,13 +49,19 @@
{% for answer in question.answers.all|dictsortreversed:"status" %}
- {{ answer.answer }}
- {% if answer.status == "0" %}
-
-
-
+ {% if answer.status == "0" %}
+
+ {% else %}
+ {{ answer.answer }}
+ {% endif %}
|
{{ answer.get_status_display|default:answer.status }} |
@@ -194,25 +200,26 @@
var CSRF_TOKEN = "{{ csrf_token }}";
function toggleWords(btn) {
- var container = btn.nextElementSibling;
+ var container = btn.nextElementSibling; // the flex-grow-1 wrapper
if (!container) return;
+ var wordContainer = container.querySelector('.word-buttons');
+ if (!wordContainer) return;
// populate if empty
- if (!container.dataset.populated) {
- var td = btn.closest('td');
- var pre = td ? td.querySelector('pre') : null;
+ if (!wordContainer.dataset.populated) {
+ var pre = container.querySelector('pre');
var text = pre ? pre.textContent || pre.innerText : '';
- buildWordButtons(container, text);
- container.dataset.populated = '1';
+ buildWordButtons(wordContainer, text);
+ wordContainer.dataset.populated = '1';
}
- var expanded = !container.classList.contains('d-none');
+ var expanded = !wordContainer.classList.contains('d-none');
if (expanded) {
- container.classList.add('d-none');
+ wordContainer.classList.add('d-none');
btn.setAttribute('aria-expanded', 'false');
- container.setAttribute('aria-hidden', 'true');
+ wordContainer.setAttribute('aria-hidden', 'true');
} else {
- container.classList.remove('d-none');
+ wordContainer.classList.remove('d-none');
btn.setAttribute('aria-expanded', 'true');
- container.setAttribute('aria-hidden', 'false');
+ wordContainer.setAttribute('aria-hidden', 'false');
}
}
|