From 5844dffc61a6379e70d5a141c36a900b2e9b9eaa Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Fri, 22 Apr 2022 17:34:48 +0200 Subject: [PATCH] fixed bug #32128: Accordeon -vertical does not react after opening one panel --- Modules/Scorm2004/scripts/questions/question_handling.js | 2 +- .../tpl.il_as_tst_man_scoring_by_question_tblrow.html | 4 ++-- Services/Accordion/js/accordion.js | 2 +- Services/COPage/templates/default/tpl.question_export.html | 6 +++--- Services/JavaScript/js/Basic.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/Scorm2004/scripts/questions/question_handling.js b/Modules/Scorm2004/scripts/questions/question_handling.js index 5cca88a86e9a..64fa2dc5d48e 100644 --- a/Modules/Scorm2004/scripts/questions/question_handling.js +++ b/Modules/Scorm2004/scripts/questions/question_handling.js @@ -942,7 +942,7 @@ ilias.questions.showFeedback = function(a_id) { const el = document.getElementById('feedback' + a_id); if (el) { el.style.display = ''; - if (typeof MathJax != "undefined") { + if (typeof MathJax != "undefined" && typeof MathJax.Hub != "undefined") { MathJax.Hub.Queue(["Typeset",MathJax.Hub, el]); } } diff --git a/Modules/Test/templates/default/tpl.il_as_tst_man_scoring_by_question_tblrow.html b/Modules/Test/templates/default/tpl.il_as_tst_man_scoring_by_question_tblrow.html index 174a251af681..d487b92cbc79 100644 --- a/Modules/Test/templates/default/tpl.il_as_tst_man_scoring_by_question_tblrow.html +++ b/Modules/Test/templates/default/tpl.il_as_tst_man_scoring_by_question_tblrow.html @@ -37,8 +37,8 @@ $this.data("modal", modal); - if (typeof MathJax != "undefined") { - MathJax.Hub.Queue(["Typeset", MathJax.Hub]); + if (typeof MathJax != "undefined" && typeof MathJax.Hub != "undefined") { + MathJax.Hub.Queue(["Typeset", MathJax.Hub]); } modal.show(); diff --git a/Services/Accordion/js/accordion.js b/Services/Accordion/js/accordion.js index 6281bc3cd424..0e9eec59021b 100644 --- a/Services/Accordion/js/accordion.js +++ b/Services/Accordion/js/accordion.js @@ -470,7 +470,7 @@ il.Accordion = { rerenderContent: function(acc_el) { // rerender mathjax - if (typeof MathJax != "undefined") { + if (typeof MathJax != "undefined" && typeof MathJax.Hub != "undefined") { MathJax.Hub.Queue(["Reprocess",MathJax.Hub, acc_el[0]]); } // see http://docs.mathjax.org/en/latest/typeset.html diff --git a/Services/COPage/templates/default/tpl.question_export.html b/Services/COPage/templates/default/tpl.question_export.html index b6e0f3e07892..5b589f4806c8 100644 --- a/Services/COPage/templates/default/tpl.question_export.html +++ b/Services/COPage/templates/default/tpl.question_export.html @@ -19,7 +19,7 @@ jQuery('div#container{VAL_ID}').autoRender(questions[{VAL_ID}]); {HANDLE_IMAGES} - if (typeof MathJax != "undefined") { + if (typeof MathJax != "undefined" && typeof MathJax.Hub != "undefined") { MathJax.Hub.Queue(["Typeset",MathJax.Hub, "container{VAL_ID}"]); } } @@ -54,7 +54,7 @@ question.init(); - if (typeof MathJax != "undefined") { + if (typeof MathJax != "undefined" && typeof MathJax.Hub != "undefined") { MathJax.Hub.Queue(["Typeset", MathJax.Hub, "container{VAL_ID}"]); } }; @@ -303,7 +303,7 @@ questionData.engineInstance = question; - if (typeof MathJax != "undefined") { + if (typeof MathJax != "undefined" && typeof MathJax.Hub != "undefined") { MathJax.Hub.Queue(["Typeset", MathJax.Hub, "container{VAL_ID}"]); } } diff --git a/Services/JavaScript/js/Basic.js b/Services/JavaScript/js/Basic.js index c867130f9504..c4691e35e3b8 100644 --- a/Services/JavaScript/js/Basic.js +++ b/Services/JavaScript/js/Basic.js @@ -271,7 +271,7 @@ il.Util = { */ print: function () { if (typeof(window.print) != 'undefined') { - if (typeof MathJax !== 'undefined') { + if (typeof MathJax != "undefined" && typeof MathJax.Hub != "undefined") { MathJax.Hub.Queue( ["Delay",MathJax.Callback,700], window.print