From: soufiane Date: Wed, 22 May 2024 12:45:23 +0000 (+0200) Subject: wip #6927 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=635e4f7095d35d633ea982c506e53fdb894a8857;p=fluidbook-toolbox-quiz.git wip #6927 --- diff --git a/js/quiz.accessibility.js b/js/quiz.accessibility.js index 2090577..5f08b0c 100644 --- a/js/quiz.accessibility.js +++ b/js/quiz.accessibility.js @@ -8,19 +8,15 @@ 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'; } $('[aria-keyshortcuts="' + key + '"]').each(function () { if ($this.quiz.utils.isEnabled($(this))) { - $(this).get(0).click(function(e) { - return false; - }); + $(this).get(0).click(); return true; } }); @@ -28,7 +24,9 @@ QuizAccessibility.prototype = { if (key === 'ENTER') { let el = $(':focus').find('[aria-keyshortcuts]') if(!el) { - $(':focus').click(function (e){ return false; }) + $('a[href=#]').click(function (e){ + return false; + }) } if ($this.quiz.utils.isEnabled(el)) { el.get(0).click((e) => { return false; });