mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
Mise en forme svg à ajouté en mode mobile
This commit is contained in:
parent
44fa052703
commit
b11ac53e29
@ -133,7 +133,11 @@ loadingTask.promise.then(function(pdf) {
|
||||
document.getElementById('btn_svn_select').classList.add('d-none');
|
||||
document.getElementById('svg_object_actions').classList.add('d-none');
|
||||
document.getElementById('svg_selected_container').classList.remove('d-none');
|
||||
document.getElementById('svg_selected').src = input.value;
|
||||
if(input.value.match(/^data:/)) {
|
||||
document.getElementById('svg_selected').src = input.value;
|
||||
} else {
|
||||
document.getElementById('svg_selected').src = input.dataset.svg;
|
||||
}
|
||||
} else {
|
||||
document.getElementById('btn_svn_select').classList.remove('d-none');
|
||||
document.getElementById('svg_object_actions').classList.add('d-none');
|
||||
@ -501,6 +505,15 @@ loadingTask.promise.then(function(pdf) {
|
||||
deleteActiveObject();
|
||||
});
|
||||
|
||||
document.getElementById('btn_svg_selected_close').addEventListener('click', function(event) {
|
||||
var input_selected = document.querySelector('input[name="svg_2_add"]:checked');
|
||||
|
||||
stateAddLock(false);
|
||||
input_selected.checked = false;
|
||||
input_selected.dispatchEvent(new Event("change"));
|
||||
this.blur();
|
||||
});
|
||||
|
||||
document.addEventListener('click', function(event) {
|
||||
if(event.target.nodeName == "DIV") {
|
||||
|
||||
@ -585,6 +598,7 @@ loadingTask.promise.then(function(pdf) {
|
||||
return;
|
||||
}
|
||||
document.getElementById('svg_object_actions').classList.remove('d-none');
|
||||
document.getElementById('svg_selected_container').classList.add('d-none');
|
||||
document.getElementById('btn_svn_select').classList.add('d-none');
|
||||
});
|
||||
|
||||
@ -592,7 +606,11 @@ loadingTask.promise.then(function(pdf) {
|
||||
if(!is_mobile()) {
|
||||
return;
|
||||
}
|
||||
document.getElementById('btn_svn_select').classList.remove('d-none');
|
||||
if(document.querySelector('input[name="svg_2_add"]:checked')) {
|
||||
document.getElementById('svg_selected_container').classList.remove('d-none');
|
||||
} else {
|
||||
document.getElementById('btn_svn_select').classList.remove('d-none');
|
||||
}
|
||||
document.getElementById('svg_object_actions').classList.add('d-none');
|
||||
});
|
||||
|
||||
|
@ -81,11 +81,9 @@
|
||||
<div class="d-grid gap-2">
|
||||
<button id="btn_svn_select" class="btn btn-light btn-lg" data-bs-toggle="offcanvas" data-bs-target="#offcanvasTop" aria-controls="offcanvasTop"><i class="bi bi-hand-index"></i> Séléctionner une signature</button>
|
||||
</div>
|
||||
<div id="svg_selected_container" class="d-grid gap-2 d-none">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-outline-secondary"><img id="svg_selected" src="" style="max-height: 40px;" class="img-fluid"/></button>
|
||||
<button class="btn btn-link" data-bs-toggle="offcanvas" data-bs-target="#offcanvasTop" aria-controls="offcanvasTop"> Changer</button>
|
||||
</div>
|
||||
<div id="svg_selected_container" class="text-center d-none position-relative">
|
||||
<img id="svg_selected" src="" style="max-height: 40px;" class="img-fluid"/>
|
||||
<button type="button" id="btn_svg_selected_close" class="btn-close text-reset position-absolute top-0 end-0"></button>
|
||||
</div>
|
||||
<div id="svg_object_actions" class="d-none">
|
||||
<button id="btn-svg-pdf-delete" class="btn btn-lg btn-light"><i class="bi bi-trash"></i></button>
|
||||
|
Loading…
Reference in New Issue
Block a user