modal w panelu admina
This commit is contained in:
0
static/js/categories_select_admin.js
Normal file
0
static/js/categories_select_admin.js
Normal file
@@ -1,15 +1,5 @@
|
||||
// preview-modal.js
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
// Inicjalizacja Tom Select dla wszystkich select[multiple]
|
||||
document.querySelectorAll('select[multiple]').forEach(function (el) {
|
||||
new TomSelect(el, {
|
||||
plugins: ['remove_button'],
|
||||
placeholder: 'Wybierz kategorie...',
|
||||
create: false,
|
||||
sortField: { field: "text", direction: "asc" },
|
||||
dropdownParent: 'body'
|
||||
});
|
||||
});
|
||||
|
||||
// Obsługa przycisków podglądu produktów
|
||||
document.querySelectorAll(".preview-btn").forEach((btn) => {
|
||||
btn.addEventListener("click", async () => {
|
||||
@@ -43,10 +33,10 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const li = document.createElement("li");
|
||||
li.className = "list-group-item bg-dark text-white d-flex justify-content-between";
|
||||
li.innerHTML = `
|
||||
<span>${item.name}</span>
|
||||
<span class="badge ${item.purchased ? 'bg-success' : item.not_purchased ? 'bg-warning text-dark' : 'bg-secondary'}">
|
||||
x${item.quantity}
|
||||
</span>`;
|
||||
<span>${item.name}</span>
|
||||
<span class="badge ${item.purchased ? 'bg-success' : item.not_purchased ? 'bg-warning text-dark' : 'bg-secondary'}">
|
||||
x${item.quantity}
|
||||
</span>`;
|
||||
|
||||
if (item.purchased) {
|
||||
purchasedList.appendChild(li);
|
Reference in New Issue
Block a user