Fix event listener
This commit is contained in:
parent
860c6bcaeb
commit
e62d296e16
@ -7,7 +7,7 @@
|
|||||||
// @match https://dofus-map.com/*
|
// @match https://dofus-map.com/*
|
||||||
// @match https://dofus-portals.fr/*
|
// @match https://dofus-portals.fr/*
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 1.1
|
// @version 1.2
|
||||||
// @author Mazoyer Alexis
|
// @author Mazoyer Alexis
|
||||||
// @description Permet de rendre cliquable toutes les positions [x,y] indiquées sur le site dofuspourlesnoobs
|
// @description Permet de rendre cliquable toutes les positions [x,y] indiquées sur le site dofuspourlesnoobs
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
@ -70,7 +70,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
allGotos[i.addEventListener('contextmenu', event => {
|
allGotos[i].addEventListener('contextmenu', event => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
if (event.srcElement.getAttribute('data-x') !== null && event.srcElement.getAttribute('data-y') !== null && !isNaN(event.srcElement.getAttribute('data-x').replace('-', '')) && !isNaN(event.srcElement.getAttribute('data-y').replace('-', ''))) {
|
if (event.srcElement.getAttribute('data-x') !== null && event.srcElement.getAttribute('data-y') !== null && !isNaN(event.srcElement.getAttribute('data-x').replace('-', '')) && !isNaN(event.srcElement.getAttribute('data-y').replace('-', ''))) {
|
||||||
copyTextToClipboard('[' + event.srcElement.getAttribute('data-x') + ',' + event.srcElement.getAttribute('data-y') + ']')
|
copyTextToClipboard('[' + event.srcElement.getAttribute('data-x') + ',' + event.srcElement.getAttribute('data-y') + ']')
|
||||||
|
Loading…
Reference in New Issue
Block a user