mirror of
https://github.com/badlogic/heissepreise.git
synced 2024-06-24 09:25:53 +02:00
JSON download of cart.
This commit is contained in:
parent
6ab871f022
commit
23b1ec978a
|
@ -20,7 +20,7 @@
|
|||
<div class="filters-container">
|
||||
<input id="filter" class="search" placeholder="Filtern..." />
|
||||
<div class="filters" id="filters-store"></div>
|
||||
<div id="numitems"></div>
|
||||
<div class="filters"><span id="numitems"></span> <a id="json" href="">JSON</a></div>
|
||||
</div>
|
||||
<table id="cartitems"></table>
|
||||
</div>
|
||||
|
|
|
@ -173,6 +173,10 @@ function showCart(cart) {
|
|||
} else {
|
||||
document.querySelector("#numitems").innerText = `${items.length} / ${cart.items.length} Artikel`;
|
||||
}
|
||||
document.querySelector("#json").addEventListener("click", (event) => {
|
||||
event.preventDefault();
|
||||
downloadFile("items.json", JSON.stringify(items, null, 2));
|
||||
});
|
||||
updateCharts(canvasDom, items);
|
||||
|
||||
const itemTable = document.querySelector("#cartitems");
|
||||
|
|
Loading…
Reference in New Issue
Block a user