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

Bug drag and drop

This commit is contained in:
Vincent LAURENT 2021-10-04 00:14:10 +02:00
parent 93ebb20a5e
commit 559ba53901

View File

@ -53,6 +53,9 @@ loadingTask.promise.then(function(pdf) {
}
svgButton.innerHTML += '<a title="Supprimer" data-index="'+i+'" class="btn-svg-list-suppression opacity-50 link-dark position-absolute" style="right: 6px; top: 2px;"><i class="bi bi-trash"></i></a>';
svgButton.draggable = true;
svgButton.addEventListener('dragstart', function(event) {
document.getElementById(this.htmlFor).checked = true;
});
var svgImg = document.createElement('img');
svgImg.src = svg.svg;
svgImg.draggable = false;
@ -67,12 +70,6 @@ loadingTask.promise.then(function(pdf) {
return svgContainer;
}
document.querySelectorAll('label.btn-svg').forEach(function(item) {
item.addEventListener('dragstart', function(event) {
document.getElementById(this.htmlFor).checked = true;
});
});
var displaysSVG = function() {
document.getElementById('svg_list').innerHTML = "";
document.getElementById('svg_list_signature').innerHTML = "";
@ -106,7 +103,6 @@ loadingTask.promise.then(function(pdf) {
localStorage.setItem('svgCollections', JSON.stringify(svgCollections));
});
});
}
document.querySelectorAll('.btn-add-svg-type').forEach(function(item) {
@ -118,6 +114,12 @@ loadingTask.promise.then(function(pdf) {
});
});
document.querySelectorAll('label.btn-svg').forEach(function(item) {
item.addEventListener('dragstart', function(event) {
document.getElementById(this.htmlFor).checked = true;
});
});
displaysSVG();
document.getElementById('btn_modal_ajouter').addEventListener('click', function() {