]> _ Git - fluidbook-toolbox-quiz.git/commitdiff
wip #6927
authorsoufiane <soufiane@cubedesigners.com>
Tue, 21 May 2024 12:54:33 +0000 (14:54 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 21 May 2024 12:54:33 +0000 (14:54 +0200)
js/quiz.accessibility.js
js/quiz.utils.js

index 4cd048bec76b8ad410e7ba5285f4ef3288e45b12..a663bd776ea228a812177d73c2f14499c1ee3681 100644 (file)
@@ -8,8 +8,10 @@ QuizAccessibility.prototype = {
     initShortcuts: function () {
         let $this = this;
         $(document).on('keyup', function (e) {
+            console.log('entrer 1')
             if($("textarea:focus,input:focus").length < 1) {
                 let key = e.key.toLocaleUpperCase();
+                console.log('key',key)
                 if (key === ' ') {
                     key = 'Space';
                 }
@@ -20,6 +22,15 @@ QuizAccessibility.prototype = {
                         return true;
                     }
                 });
+
+                if (key === 'Enter') {
+                    console.log("enter 2")
+                    $(":focus").get(0).click(function(e) {
+                        console.log('ok')
+                        e.preventDefault()
+                    })
+                    return true;
+                }
             }
         });
 
index 805a6a17aba1f852649018c9e9333bf0f4b5bcf2..cc01d45668662633a4f2f90502b3fc550dc4e9c1 100644 (file)
@@ -26,6 +26,9 @@ QuizUtils.prototype = {
         if ($(e).hasClass('disabled') || $(e).closest('.disabled').length > 0) {
             return false;
         }
+        if($(e).attr('href') !== "#") {
+            return false;
+        }
         return true;
     },