Index: gc_lang/fr/webext/content_scripts/init.js ================================================================== --- gc_lang/fr/webext/content_scripts/init.js +++ gc_lang/fr/webext/content_scripts/init.js @@ -62,13 +62,13 @@ oOptions: null, listenRightClick: function () { // Node where a right click is done // Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1325814 - document.addEventListener('contextmenu', function (xEvent) { + document.addEventListener('contextmenu', (xEvent) => { this.xRightClickedNode = xEvent.target; - }.bind(this), true); + }, true); }, clearRightClickedNode: function () { this.xRightClickedNode = null; }, Index: gc_lang/fr/webext/content_scripts/panel.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel.js +++ gc_lang/fr/webext/content_scripts/panel.js @@ -71,30 +71,28 @@ return xButtonLine; } _createWaitIcon () { let xWaitIcon = oGrammalecte.createNode("div", {className: "grammalecte_spinner"}); - //xWaitIcon.appendChild(oGrammalecte.createNode("div", {className: "bounce1"})); - //xWaitIcon.appendChild(oGrammalecte.createNode("div", {className: "bounce2"})); return xWaitIcon; } _createCopyButton () { let xButton = oGrammalecte.createNode("div", {id: "grammalecte_clipboard_button", className: "grammalecte_panel_button grammalecte_copy_button", textContent: "∑", title: "Copier dans le presse-papiers"}); - xButton.onclick = function () { this.copyTextToClipboard(); }.bind(this); + xButton.onclick = () => { this.copyTextToClipboard(); }; return xButton; } _createMoveButton (sAction, sLabel, sTitle) { let xButton = oGrammalecte.createNode("div", {className: "grammalecte_panel_button grammalecte_move_button", textContent: sLabel, title: sTitle}); - xButton.onclick = function () { this[sAction](); }.bind(this); + xButton.onclick = () => { this[sAction](); }; return xButton; } _createCloseButton () { let xButton = oGrammalecte.createNode("div", {className: "grammalecte_panel_button grammalecte_close_button", textContent: "×", title: "Fermer la fenêtre"}); - xButton.onclick = function () { this.hide(); }.bind(this); // better than writing “let that = this;” before the function? + xButton.onclick = () => { this.hide(); }; return xButton; } insertIntoPage () { if (this.bShadow) {