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

Pas d'ajout si un object est séléctionné

This commit is contained in:
Vincent LAURENT 2021-11-13 01:07:40 +01:00
parent 7db5d212db
commit 7bbacb406c

View File

@ -147,12 +147,6 @@ loadingTask.promise.then(function(pdf) {
input_selected = null;
}
if(input_selected) {
document.body.style.setProperty('cursor', 'copy');
} else {
document.body.style.removeProperty('cursor');
}
document.querySelectorAll('.btn-svg').forEach(function(item) {
if(input_selected && item.htmlFor == input_selected.id) {
item.style.setProperty('cursor', 'copy');
@ -214,6 +208,9 @@ loadingTask.promise.then(function(pdf) {
svgButton.addEventListener('dblclick', function(event) {
svgDblClick(this, event);
});
svgButton.addEventListener('mouseout', function(event) {
this.style.removeProperty('cursor');
})
var svgImg = document.createElement('img');
svgImg.src = svg.svg;
svgImg.draggable = false;
@ -816,12 +813,16 @@ loadingTask.promise.then(function(pdf) {
});
canvasEdition.on('mouse:down', function(event) {
if(event.target) {
this.defaultCursor = 'default';
return;
}
var input_selected = document.querySelector('input[name="svg_2_add"]:checked');
if(currentCursor == 'default' && input_selected) {
this.defaultCursor = 'copy';
}
if(currentCursor != 'copy') {
return;
}
var input_selected = document.querySelector('input[name="svg_2_add"]:checked');
if(!input_selected) {
return;
}