From: Vincent Vanwaelscappel Date: Fri, 28 Jul 2023 14:53:23 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/quiz2' into quiz2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=24b61fb545cc0cb83e02ae2e02366a5df59de6be;p=fluidbook-toolbox.git Merge remote-tracking branch 'origin/quiz2' into quiz2 # Conflicts: # resources/quizv2/js/quiz.animations.js --- 24b61fb545cc0cb83e02ae2e02366a5df59de6be diff --cc resources/quizv2/js/quiz.animations.js index 8ebdb988a,a7883bc98..59fa52232 --- a/resources/quizv2/js/quiz.animations.js +++ b/resources/quizv2/js/quiz.animations.js @@@ -9,17 -9,20 +9,19 @@@ QuizAnimations.prototype = // Load the animation "name" in container load: function (name, container, replace) { let json = this.quiz.data.animations[name]; - $.each(replace, function (k, v) { - json = json.replace(new RegExp(k, 'g'), v); + if(json) { + $.each(replace, function (k, v) { - console.log(k, v); + json = json.replace(new RegExp(k, 'g'), v); - }); + }); - lottie.loadAnimation({ - container: $(container).get(0), - renderer: 'svg', - loop: false, - autoplay: true, - animationData: JSON.parse(json), - }); + lottie.loadAnimation({ + container: $(container).get(0), + renderer: 'svg', + loop: false, + autoplay: true, + animationData: JSON.parse(json), + }); + } } }