]> _ Git - fluidbook-toolbox.git/commitdiff
Merge remote-tracking branch 'origin/quiz2' into quiz2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Jul 2023 14:53:23 +0000 (16:53 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Jul 2023 14:53:23 +0000 (16:53 +0200)
# Conflicts:
# resources/quizv2/js/quiz.animations.js

1  2 
resources/quizv2/js/quiz.animations.js
resources/quizv2/js/quiz.js

index 8ebdb988ab92635c8181ef397bffb51c9fbb3af1,a7883bc98c107ebe62516205628af96e513ee51b..59fa52232f5696357cc1bfd714685298264dbfd2
@@@ -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),
+             });
+         }
      }
  }
  
Simple merge