diff --git a/public/js/app.js b/public/js/app.js index b1ad772..00d727e 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -91,7 +91,6 @@ loadingTask.promise.then(function(pdf) { stateAddLock(false); - var input_selected = document.querySelector('input[name="svg_2_add"]:checked'); if(input_selected) { document.body.style.setProperty('cursor', 'copy'); @@ -101,8 +100,14 @@ loadingTask.promise.then(function(pdf) { document.querySelectorAll('.btn-svg').forEach(function(item) { if(input_selected && item.htmlFor == input_selected.id) { item.style.setProperty('cursor', 'copy'); + if(item.querySelector('.btn-svg-list-suppression')) { + item.querySelector('.btn-svg-list-suppression').classList.add('d-none'); + } } else { item.style.removeProperty('cursor'); + if(item.querySelector('.btn-svg-list-suppression')) { + item.querySelector('.btn-svg-list-suppression').classList.remove('d-none'); + } } }); @@ -143,11 +148,12 @@ loadingTask.promise.then(function(pdf) { document.getElementById(this.htmlFor).dispatchEvent(new Event("change")); }); svgButton.addEventListener('click', function(event) { - if(event.detail > 1 && document.getElementById(this.htmlFor).checked){ - stateAddLock(true); + if(event.detail == 1) { + this.dataset.lock = parseInt(addLock*1); } - if(event.detail > 1 && !document.getElementById(this.htmlFor).checked){ - stateAddLock(false); + if(event.detail > 1){ + console.log(parseInt(this.dataset.lock*1)); + stateAddLock(parseInt(this.dataset.lock*1) != 1); } if(event.detail > 1) { return; @@ -159,6 +165,11 @@ loadingTask.promise.then(function(pdf) { document.getElementById(this.htmlFor).dispatchEvent(new Event("change")); event.preventDefault(); }); + svgButton.addEventListener('dblclick', function(event) { + if(parseInt(this.dataset.lock*1) != 1) { + stateAddLock(true); + } + }); var svgImg = document.createElement('img'); svgImg.src = svg.svg; svgImg.draggable = false; diff --git a/templates/pdf.html.php b/templates/pdf.html.php index 26ce513..17a45d4 100644 --- a/templates/pdf.html.php +++ b/templates/pdf.html.php @@ -15,11 +15,18 @@ src: url(/vendor/fonts/Caveat-Regular.ttf) format('truetype'); } - .offcanvas .list-item-add label:hover, .offcanvas .list-item-add label:active, .offcanvas .list-item-add label.active, .offcanvas .list-item-add .btn-check:active + .btn-outline-secondary, .offcanvas .list-item-add .btn-check:checked + .btn-outline-secondary { + .offcanvas .list-item-add label:hover { + background: #e8ebed; + border: 1px solid #505050; + } + + .offcanvas .list-item-add label:active, .offcanvas .list-item-add label.active, .offcanvas .list-item-add .btn-check:active + .btn-outline-secondary, .offcanvas .list-item-add .btn-check:checked + .btn-outline-secondary { background: #c9d1d8; border: 1px solid #000; - box-shadow: 0 .25rem .5rem rgba(0,0,0,.075) !important + box-shadow: 0 .25rem .5rem rgba(0,0,0,.075) !important; } + + Signature PDF @@ -55,7 +62,7 @@
- +