1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

Lors du mode "Garder la séléction active" il est aussi possible de

désactiver l'ajout avec un simple clique
This commit is contained in:
Vincent LAURENT 2021-10-29 22:19:03 +02:00
parent e2248fb436
commit 9f8d0b2fa1

View File

@ -143,22 +143,22 @@ loadingTask.promise.then(function(pdf) {
document.getElementById(this.htmlFor).dispatchEvent(new Event("change"));
});
svgButton.addEventListener('click', function(event) {
if(event.detail > 1){
if(event.detail > 1 && document.getElementById(this.htmlFor).checked){
stateAddLock(true);
}
if(event.detail > 1 && !document.getElementById(this.htmlFor).checked){
stateAddLock(false);
}
if(event.detail > 1) {
return;
}
if(!document.getElementById(this.htmlFor).checked) {
return;
}
if(addLock) {
return;
}
document.getElementById(this.htmlFor).checked = false;
document.getElementById(this.htmlFor).dispatchEvent(new Event("change"));
event.preventDefault();
});
svgButton.addEventListener('dblclick', function(event) {
stateAddLock(!addLock);
});
var svgImg = document.createElement('img');
svgImg.src = svg.svg;
svgImg.draggable = false;