From a86a3ad5e62954c8a4b669f4cb0eadb29bcdb558 Mon Sep 17 00:00:00 2001
From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr>
Date: Sun, 12 Jan 2025 20:50:50 +0100
Subject: [PATCH] Hide disabled checkboxes

---
 macao/assets/_custom.scss | 2 +-
 macao/assets/quiz.js      | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/macao/assets/_custom.scss b/macao/assets/_custom.scss
index 4f69830..5162764 100644
--- a/macao/assets/_custom.scss
+++ b/macao/assets/_custom.scss
@@ -51,7 +51,7 @@ select.sd-dropdown.inline-dropdown, input.sd-input.inline-input {
 // ***********************************
 // Hide disabled checkboxes in some quizz
 // ***********************************
-[data-name="pg665"] {
+.hide-disabled-checkboxes {
   .sd-checkbox--readonly {
     span.sd-checkbox__decorator {
       display: none;
diff --git a/macao/assets/quiz.js b/macao/assets/quiz.js
index 8ca6271..e441f1a 100644
--- a/macao/assets/quiz.js
+++ b/macao/assets/quiz.js
@@ -63,8 +63,13 @@ $(function () {
     });
 
     survey.onAfterRenderQuestion.add((survey, options) => {
-        if (options.question.customFormat && options.question.customFormat === "one_line") {
-            $(options.htmlElement).addClass("one-line");
+        if (options.question.customFormat) {
+            if (options.question.customFormat === "one_line") {
+                $(options.htmlElement).addClass("one-line");
+            }
+            if(options.question.customFormat === "hide_disabled-checkboxes") {
+                $(options.htmlElement).addClass("hide-disabled-checkboxes");
+            }
         }
     });
 
-- 
GitLab