1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-06-07 08:22:16 +02:00

Share link in sharing mode

This commit is contained in:
Vincent LAURENT 2022-04-01 15:03:50 +02:00
parent 5a7d9f2a6a
commit 0c34e442cd
2 changed files with 10 additions and 3 deletions

View file

@ -940,7 +940,9 @@ var modalSharing = function() {
let modalInformations = bootstrap.Modal.getOrCreateInstance(modalInformationsEl);
modalInformations.show();
modalInformationsEl.addEventListener('hidden.bs.modal', function (event) {
history.pushState({}, '', window.location.href.replace(/#.*$/, ''));
if(window.location.hash) {
history.pushState({}, '', window.location.href.replace(/#.*$/, ''));
}
})
}
@ -949,7 +951,9 @@ var modalSharing = function() {
let modalSigned = bootstrap.Modal.getOrCreateInstance(modalSignedEl);
modalSigned.show();
modalSignedEl.addEventListener('hidden.bs.modal', function (event) {
history.pushState({}, '', window.location.href.replace(/#.*$/, ''));
if(window.location.hash) {
history.pushState({}, '', window.location.href.replace(/#.*$/, ''));
}
})
}
}

View file

@ -91,7 +91,10 @@
<button class="btn btn-primary w-100 mt-2" disabled="disabled" type="submit" id="save"><i class="bi bi-download"></i> Télécharger le PDF signé</button>
</form>
<?php else: ?>
<a id="btn_download" class="btn btn-outline-dark w-100" href="/signature/<?php echo $hash ?>/pdf"><i class="bi bi-download"></i> Télécharger le PDF</a>
<div class="btn-group w-100">
<a id="btn_download" class="btn btn-outline-dark w-100" href="/signature/<?php echo $hash ?>/pdf"><i class="bi bi-download"></i> Télécharger le PDF</a>
<button class="btn btn-outline-dark" type="button" id="save_share" data-bs-toggle="modal" data-bs-target="#modal-share-informations"><i class="bi bi-share"></i></button>
</div>
<form id="form_pdf" action="/signature/<?php echo $hash ?>/save" method="post" enctype="multipart/form-data">
<input id="input_svg" name="svg[]" type="file" class="d-none" />
<button class="btn btn-primary w-100 mt-2" disabled="disabled" type="submit" id="save"><i class="bi bi-check-circle"></i> Enregistrer ma signature</button>