]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wait #6809 @1:30 Modification de l'appel de outro
authorsoufiane <soufiane@cubedesigners.com>
Tue, 19 Mar 2024 16:31:00 +0000 (17:31 +0100)
committersoufiane <soufiane@cubedesigners.com>
Tue, 19 Mar 2024 16:31:00 +0000 (17:31 +0100)
js/quiz.screen.outro.js
js/quiz.screens.js

index 5283d619ae07465917332e0745d9cbbd6f5e8c96..fbba9b0c7a59cb7cc4e1184e2b57c33dba8030e8 100644 (file)
@@ -7,15 +7,13 @@ import {DrawSVGPlugin} from "gsap/DrawSVGPlugin.js";
 function QuizScreenOutro(screens) {
     this.quiz = screens.quiz;
     this.screens = screens;
-
-    this.initEvents();
 }
 
 QuizScreenOutro.prototype = {
     initEvents: function () {
         const $this = this;
-        let popup = $("#resume")
-        let quiz = $("#quiz").get(0)
+        this.popup = $("#resume")
+        this.quizEL = $("#quiz").get(0)
 
         $(document).on("click", ".toggle-answers-review", function () {
             $(".score-answers-review_container").toggleClass("active")
@@ -25,25 +23,27 @@ QuizScreenOutro.prototype = {
         });
 
         $(document).on("mousemove", function(e) {
-            let x = e.clientX - quiz.getBoundingClientRect().left
-            let y = e.clientY - quiz.getBoundingClientRect().top
+            let x = e.clientX - $this.quizEL.getBoundingClientRect().left
+            let y = e.clientY - $this.quizEL.getBoundingClientRect().top
 
-            popup.css({
+            $this.popup.css({
                 left: x,
                 top: y,
             })
         });
 
         $(document).on("mouseover", ".area-item, .match-item, .multiple-item", function (e) {
-            let content = $(this).find(".content").html()
+            let content = $(this).find(".content").text()
 
             if(content) {
-                popup.html(content)
-                gsap.to(popup, {autoAlpha: 1})
+                $this.popup.html(content)
+                gsap.to($this.popup, {autoAlpha: 1})
             }
         }).on("mouseout", function () {
-            gsap.to(popup, {autoAlpha: 0})
+            gsap.to($this.popup, {autoAlpha: 0})
         })
+
+        this.show();
     },
 
     animate: function (score, percent) {
index 9fb995e4a6bd5c9bfa1d6b0422a5ea31fe179346..390f4cdac1f43a490d68597fcb99db05a5ba00ae 100644 (file)
@@ -187,7 +187,7 @@ QuizScreens.prototype = {
             $this.quiz.progressbar.update();
 
             if (screen === 'outro') {
-                $this.outro.show();
+                $this.outro.initEvents();
             }
 
             $this.quiz.resize.resize();
@@ -338,7 +338,9 @@ QuizScreens.prototype = {
     validateEmail: function (email) {
         let re = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
         return re.test(email);
-    }, reset: function () {
+    },
+
+    reset: function () {
         $("#screens").html(this.screensHTML);
     }
 };