From 5b5817ec374c09e6e3bf7114dc5c3acb4129285f Mon Sep 17 00:00:00 2001 From: Francesc Busquets Date: Thu, 10 Jun 2021 11:53:49 +0200 Subject: [PATCH] :rotating_light: Use jQuery 'on' instead of specific event functions --- src/activities/text/TextActivityBase.js | 2 +- src/activities/textGrid/CrossWord.js | 2 +- src/boxes/ActiveBox.js | 2 +- src/skins/CustomSkin.js | 2 +- src/skins/DefaultSkin.js | 2 +- src/skins/Skin.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/activities/text/TextActivityBase.js b/src/activities/text/TextActivityBase.js index 8a91578f..1beee3c9 100644 --- a/src/activities/text/TextActivityBase.js +++ b/src/activities/text/TextActivityBase.js @@ -450,7 +450,7 @@ export class TextActivityBasePanel extends ActivityPanel { if ($popup) { $popup.css({ display: '' }); - $popup.click(); + $popup.trigger('click'); this.$currentPopup = $popup; if (maxTime) { diff --git a/src/activities/textGrid/CrossWord.js b/src/activities/textGrid/CrossWord.js index 28acf3b3..67b5c5ec 100644 --- a/src/activities/textGrid/CrossWord.js +++ b/src/activities/textGrid/CrossWord.js @@ -156,7 +156,7 @@ export class CrossWordPanel extends ActivityPanel { 'background-position': 'center', 'border-radius': 6, 'z-index': 10 - }).click(() => { + }).on('click', () => { this.advance = type === 'acrossClues' ? this.advance === 'ADVANCE_RIGHT' ? 'NO_ADVANCE' : 'ADVANCE_RIGHT' : diff --git a/src/boxes/ActiveBox.js b/src/boxes/ActiveBox.js index fed5a71e..79703f14 100644 --- a/src/boxes/ActiveBox.js +++ b/src/boxes/ActiveBox.js @@ -727,7 +727,7 @@ export class ActiveBox extends AbstractBox { disabled: disabled }) .html(this.toString()) - .click(ev => { + .on('click', ev => { // Check if event was produced by a mouse click if (ev.originalEvent && (ev.originalEvent.pageX !== 0 || ev.originalEvent.pageY !== 0)) { // Mouse clicks should be processed odirectly by the canvas, so ignore this accessible event diff --git a/src/skins/CustomSkin.js b/src/skins/CustomSkin.js index 2c6a38b6..7f7d34c2 100644 --- a/src/skins/CustomSkin.js +++ b/src/skins/CustomSkin.js @@ -79,7 +79,7 @@ export class CustomSkin extends Skin { this.msgBox = new ActiveBox(); this.msgBox.role = 'message'; this.$msgBoxDiv = $('
', { class: 'JClicMsgBox' }) - .click(() => { + .on('click', () => { this.msgBox.playMedia(ps); return false; }); diff --git a/src/skins/DefaultSkin.js b/src/skins/DefaultSkin.js index 1b6af99f..9004c61e 100644 --- a/src/skins/DefaultSkin.js +++ b/src/skins/DefaultSkin.js @@ -91,7 +91,7 @@ export class DefaultSkin extends Skin { this.msgBox = new ActiveBox(); this.msgBox.role = 'message'; this.$msgBoxDiv = $('
', { class: 'JClicMsgBox' }) - .click(() => { + .on('click', () => { this.msgBox.playMedia(ps); return false; }); diff --git a/src/skins/Skin.js b/src/skins/Skin.js index c5c80ef7..799d536f 100644 --- a/src/skins/Skin.js +++ b/src/skins/Skin.js @@ -156,7 +156,7 @@ export class Skin extends Container { this.$infoHead = $('
', { class: 'infoHead' }) .append($('
', { class: 'headTitle unselectableText' }) .append($(this.appLogo, { 'aria-label': msg }).css({ width: '1.5em', height: '1.5em', 'vertical-align': 'bottom' }) - .dblclick(() => { + .on('dblclick', () => { // Double click on JClic logo is a hidden method to increase verbosity on Javascript console setLogLevel('all'); log('trace', 'Log level set to "trace"');