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;
}
});
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; });