1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

Ajout de texte en mode mobile

This commit is contained in:
Vincent LAURENT 2021-10-12 01:57:10 +02:00
parent c0f405ebe8
commit a37f68c626
2 changed files with 17 additions and 2 deletions

View File

@ -51,7 +51,6 @@ loadingTask.promise.then(function(pdf) {
}
var storeCollections = function () {
console.log('store');
localStorage.setItem('svgCollections', JSON.stringify(svgCollections));
}
@ -220,6 +219,19 @@ loadingTask.promise.then(function(pdf) {
document.querySelectorAll('input[name="svg_2_add"]').forEach(function (item) {
item.addEventListener('change', function() {
if(this.checked) {
document.getElementById('btn_svn_select').classList.add('d-none');
document.getElementById('svg_selected_container').classList.remove('d-none');
document.getElementById('svg_selected').src = (this.dataset.svg) ? this.dataset.svg : this.value;
} else {
document.getElementById('btn_svn_select').classList.remove('d-none');
document.getElementById('svg_selected_container').classList.add('d-none');
document.getElementById('svg_selected').src = null;
}
addLock = false;
document.querySelectorAll('.btn-svg').forEach(function(item) {
item.style.borderWidth = "1px";
});
canvasEditions.forEach(function(canvasEdition, index) {
var input_selected = document.querySelector('input[name="svg_2_add"]:checked');
if(input_selected) {
@ -228,6 +240,9 @@ loadingTask.promise.then(function(pdf) {
canvasEdition.defaultCursor = 'default';
}
})
if(is_mobile()) {
menuOffcanvas.hide();
}
});
});

View File

@ -50,7 +50,7 @@
<label data-bs-toggle="modal" data-bs-target="#modalAddSvg" data-type="rubber_stamber" data-modalnav="#nav-import-tab" class="btn btn-outline-secondary text-black text-start btn-add-svg-type" for="radio_svg_rubber_stamber_add"><i class="bi bi-card-text"></i> Tampon <small class="text-muted float-end">Ajouter</small></label>
</div>
<div class="d-grid gap-2 mb-2 list-item-add">
<input type="radio" class="btn-check" id="radio_svg_text" name="svg_2_add" autocomplete="off" value="text">
<input type="radio" class="btn-check" id="radio_svg_text" data-svg="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iY3VycmVudENvbG9yIiBjbGFzcz0iYmkgYmktdGV4dGFyZWEtdCIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBkPSJNMS41IDIuNUExLjUgMS41IDAgMCAxIDMgMWgxMGExLjUgMS41IDAgMCAxIDEuNSAxLjV2My41NjNhMiAyIDAgMCAxIDAgMy44NzRWMTMuNUExLjUgMS41IDAgMCAxIDEzIDE1SDNhMS41IDEuNSAwIDAgMS0xLjUtMS41VjkuOTM3YTIgMiAwIDAgMSAwLTMuODc0VjIuNXptMSAzLjU2M2EyIDIgMCAwIDEgMCAzLjg3NFYxMy41YS41LjUgMCAwIDAgLjUuNWgxMGEuNS41IDAgMCAwIC41LS41VjkuOTM3YTIgMiAwIDAgMSAwLTMuODc0VjIuNUEuNS41IDAgMCAwIDEzIDJIM2EuNS41IDAgMCAwLS41LjV2My41NjN6TTIgN2ExIDEgMCAxIDAgMCAyIDEgMSAwIDAgMCAwLTJ6bTEyIDBhMSAxIDAgMSAwIDAgMiAxIDEgMCAwIDAgMC0yeiIvPjxwYXRoIGQ9Ik0xMS40MzQgNEg0LjU2Nkw0LjUgNS45OTRoLjM4NmMuMjEtMS4yNTIuNjEyLTEuNDQ2IDIuMTczLTEuNDk1bC4zNDMtLjAxMXY2LjM0M2MwIC41MzctLjExNi42NjUtMS4wNDkuNzQ4VjEyaDMuMjk0di0uNDIxYy0uOTM4LS4wODMtMS4wNTQtLjIxLTEuMDU0LS43NDhWNC40ODhsLjM0OC4wMWMxLjU2LjA1IDEuOTYzLjI0NCAyLjE3MyAxLjQ5NmguMzg2TDExLjQzNCA0eiIvPjwvc3ZnPgo=" name="svg_2_add" autocomplete="off" value="text">
<label draggable="true" style="cursor: grab;" class="btn btn-outline-secondary text-black text-start btn-svg" for="radio_svg_text"><i class="bi bi-textarea-t"></i> Texte</label>
</div>
<div id="svg_list" class="d-grid gap-2 mt-2 mb-2 list-item-add"></div>