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

Bouton pour zoomer et dezoomer en mode mobile

This commit is contained in:
Vincent LAURENT 2021-10-10 22:31:33 +02:00
parent 33ddbb9e27
commit 5b2ae3a80e
2 changed files with 13 additions and 1 deletions

View file

@ -440,7 +440,13 @@ loadingTask.promise.then(function(pdf) {
zoomChange(1)
}
}, { passive: false });
document.getElementById('btn-zoom-decrease').addEventListener('click', function() {
zoomChange(-1)
});
document.getElementById('btn-zoom-increase').addEventListener('click', function() {
zoomChange(1)
});
var autoZoom = function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(resizePDF, 100);
@ -543,6 +549,8 @@ loadingTask.promise.then(function(pdf) {
viewport = page.getViewport({ scale: scale });
}
currentScale = scale;
var pageIndex = page.pageNumber - 1;
document.getElementById('form_pdf').insertAdjacentHTML('beforeend', '<input name="svg[' + pageIndex + ']" id="data-svg-' + pageIndex + '" type="hidden" value="" />');

View file

@ -81,6 +81,10 @@
</div>
</div>
<div class="position-fixed bottom-0 start-0 bg-white w-100 p-2 shadow d-md-none">
<div class="btn-group position-absolute opacity-25" style="top: -46px;">
<button id="btn-zoom-decrease" class="btn btn-secondary"><i class="bi bi-dash"></i></button>
<button id="btn-zoom-increase" class="btn btn-secondary"><i class="bi bi-plus"></i></button>
</div>
<div class="d-grid gap-2">
<button class="btn btn-primary" disabled="disabled" type="submit" id="save_mobile"><i class="bi bi-download"></i> Télécharger le PDF Signé</button>
</div>