Gustavo Luigi 2022-09-02 12:59:31 +02:00
parent af4da1a8a3
commit 53f1938ef1
1 changed files with 7 additions and 2 deletions

View File

@ -217,8 +217,8 @@

<div class="input-group input-group-lg">

<input type="text" class="form-control cart-link" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-lg" value="393" readonly>
<span class="input-group-text" id="inputGroup-sizing-lg">
<input type="text" class="form-control cart-link" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-lg" style="box-shadow: none;" readonly>
<span class="input-group-text" id="btn-copy-cart-link">
<svg style="fill: currentColor; width: 18px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM352 32.491a15.88 15.88 0 0 1 7.431 4.195l51.882 51.883A15.885 15.885 0 0 1 415.508 96H352V32.491zM288 464c0 8.822-7.178 16-16 16H48c-8.822 0-16-7.178-16-16V144c0-8.822 7.178-16 16-16h80v240c0 26.51 21.49 48 48 48h112v48zm128-96c0 8.822-7.178 16-16 16H176c-8.822 0-16-7.178-16-16V48c0-8.822 7.178-16 16-16h144v72c0 13.2 10.8 24 24 24h72v240z"/></svg>
</span>
</div>
@ -422,6 +422,11 @@
objProducts[index].quantity = quantity;
updateProductsInLocalStorage();
});
$('#btn-copy-cart-link').click(function(){
$('.cart-link').select();
document.execCommand("copy");
$(this).html(`<svg style="fill: green; width: 18px;"xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zm0 32c8.823 0 16 7.178 16 16v352c0 8.822-7.177 16-16 16H48c-8.822 0-16-7.178-16-16V80c0-8.822 7.178-16 16-16h352m-34.301 98.293l-8.451-8.52c-4.667-4.705-12.265-4.736-16.97-.068l-163.441 162.13-68.976-69.533c-4.667-4.705-12.265-4.736-16.97-.068l-8.52 8.451c-4.705 4.667-4.736 12.265-.068 16.97l85.878 86.572c4.667 4.705 12.265 4.736 16.97.068l180.48-179.032c4.704-4.667 4.735-12.265.068-16.97z"/></svg>`);
});
});
</script>
@yield('scripts')