Skip to content

Commit

Permalink
hack around buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisns committed May 20, 2024
1 parent f3e25e1 commit e208452
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/assessment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ eleventyNavigation:
{{ govukFileUpload({
id: "reportUpload",
name: "reportUpload",
classes: "govuk-!-display-none"
classes: "govuk-!-display-none",
attributes: {
onChange: "loadReport(event)"
}
}) }}
{% include 'nextAssessmentButton.njk' %}
{{ govukButton({
Expand Down
5 changes: 4 additions & 1 deletion src/assessment/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ title: Report
{{ govukFileUpload({
id: "reportUpload",
name: "reportUpload",
classes: "govuk-!-display-none"
classes: "govuk-!-display-none",
attributes: {
onChange: "loadReport(event)"
}
}) }}
{{ govukButton({
text: "Save this report",
Expand Down
4 changes: 0 additions & 4 deletions src/assets/cmm_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function renderFullReport() {
const provided_answer = cmm()?.categories[category]?.questions[question];
if (provided_answer && parseInt(provided_answer) === parseInt(answer)) {
elem.style.display = "initial";
console.log(cmm());
if (getPreviousSibling(elem, "h2"))
getPreviousSibling(elem, "h2").style.display = "block";
continue;
Expand Down Expand Up @@ -169,9 +168,6 @@ function download(content, fileName, contentType) {

window.addEventListener("load", renderReport);
window.addEventListener("load", renderFullReport);
document
.getElementById("reportUpload")
.addEventListener("change", loadReport, false);

if (typeof module === "object")
module.exports = {
Expand Down

0 comments on commit e208452

Please sign in to comment.