hide answer form if no question live
This commit is contained in:
@@ -7,9 +7,10 @@
|
|||||||
body {
|
body {
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
}
|
}
|
||||||
:not(#answers-list[hidden]) + #question,
|
:not(#answers-list[hidden]) + #question-text,
|
||||||
:not(#answers-list[hidden]) + #question + #answer-form,
|
:not(#answers-list[hidden]) + #question-text + #answer-form,
|
||||||
:not(#question-options:empty) + #answers-freeform
|
:not(#question-options:empty) + #answers-freeform,
|
||||||
|
#question-text:empty + #answer-form
|
||||||
{
|
{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@@ -17,9 +18,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<body>
|
<body>
|
||||||
<div id="answers-list"></div>
|
<div id="answers-list"></div>
|
||||||
<div id="question">
|
<div id="question-text"></div>
|
||||||
<h1><span id="question-text"></span></h1>
|
|
||||||
</div>
|
|
||||||
<form id="answer-form" action="#" onsubmit="submitAnswersForm(this); return false;">
|
<form id="answer-form" action="#" onsubmit="submitAnswersForm(this); return false;">
|
||||||
<div id="question-options"></div>
|
<div id="question-options"></div>
|
||||||
<input id="answers-freeform" type="text" hidden/>
|
<input id="answers-freeform" type="text" hidden/>
|
||||||
@@ -55,8 +54,9 @@
|
|||||||
<label for="${i}">${i}</label>
|
<label for="${i}">${i}</label>
|
||||||
</div>`
|
</div>`
|
||||||
options = `<fieldset>${options}</fieldset>`;
|
options = `<fieldset>${options}</fieldset>`;
|
||||||
if (document.getElementById("question-text").innerHTML != g_live_question.Text) {
|
if (document.getElementById("question-text").value != g_live_question.Text) {
|
||||||
document.getElementById("question-text").innerHTML = g_live_question.Text;
|
document.getElementById("question-text").innerHTML = `<h1>${g_live_question.Text}</h1>`;
|
||||||
|
document.getElementById("question-text").value = g_live_question.Text;
|
||||||
document.getElementById("question-options").innerHTML = options;
|
document.getElementById("question-options").innerHTML = options;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user