1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-06-04 23:12:25 +02:00

background plus léger pour les motifs séléctionnés

This commit is contained in:
Vincent LAURENT 2021-10-02 01:27:59 +02:00
parent 5bccb2a5ce
commit 8dd4c9b645
2 changed files with 16 additions and 4 deletions

View file

@ -53,11 +53,16 @@ loadingTask.promise.then(function(pdf) {
document.getElementById('btn-add-svg').classList.add('btn-primary');
document.getElementById('btn-add-svg').classList.remove('btn-light');
if(svgCollections.length > 0) {
document.getElementById('btn-add-svg').classList.add('btn-light');
document.getElementById('btn-add-svg').classList.remove('btn-primary');
}
if(document.getElementById('btn-add-svg').classList.contains('btn-primary')) {
document.getElementById('btn-add-svg').focus();
}
document.querySelectorAll('.btn-svg-list-suppression').forEach(function(item) {
item.addEventListener('click', function() {
svgCollections.splice(this.dataset.index, 1);
@ -270,7 +275,9 @@ loadingTask.promise.then(function(pdf) {
if(!input_selected) {
return;
}
save.removeAttribute('disabled');
x = event.pointer.x
y = event.pointer.y
@ -296,7 +303,6 @@ loadingTask.promise.then(function(pdf) {
canvasEdition.add(svg).renderAll();
});
save.removeAttribute('disabled');
});
canvasEditions.push(canvasEdition);

View file

@ -14,6 +14,12 @@
font-weight: 400;
src: url(/vendor/fonts/Caveat-Regular.ttf) format('truetype');
}
aside .list-item-add label:hover, aside .list-item-add label:active, aside .list-item-add label.active, aside .list-item-add .btn-check:active + btn-outline-secondary, aside .list-item-add .btn-check:checked + .btn-outline-secondary {
background: #e6ebf0;
border: 1px solid #000;
box-shadow: 0 .25rem .5rem rgba(0,0,0,.075) !important
}
</style>
<title>Signature PDF</title>
</head>
@ -24,12 +30,12 @@
<aside class="col-lg-2 col-md-3 col-sm-4 col-xs-6 mt-2 position-fixed end-0 bg-white">
<h5 class="mb-0">Motifs</h5>
<small class="text-muted">Signature, paraphe, tampon, etc.</small>
<div id="svg_list" class="d-grid gap-2 mt-2"></div>
<div id="svg_list" class="d-grid gap-2 mt-2 list-item-add"></div>
<div class="d-grid gap-2 mt-2">
<button type="button" id="btn-add-svg" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalAddSvg"><i class="bi bi-plus-circle"></i> Ajouter un motif</button>
</div>
<h5 class="mt-3">Texte</h5>
<div class="d-grid gap-2 mt-3">
<div class="d-grid gap-2 mt-3 list-item-add">
<input type="radio" class="btn-check" id="radio_svg_text" name="svg_2_add" autocomplete="off" value="text">
<label class="btn btn-outline-secondary text-black text-start" for="radio_svg_text"><i class="bi bi-textarea-t"></i> Zone de texte</label>
</div>