Ukrycie opcji wzywania kelnera
This commit is contained in:
@@ -798,6 +798,55 @@ window.fetchGUS = function () {
|
||||
}, 1200);
|
||||
};
|
||||
|
||||
// --- DYNAMIC MENU LOADING ---
|
||||
async function loadMenu() {
|
||||
try {
|
||||
const response = await fetch('menu.json');
|
||||
if (!response.ok) throw new Error('Nie udało się załadować menu');
|
||||
const menuData = await response.json();
|
||||
const container = document.getElementById('menuContainer');
|
||||
if (!container) return;
|
||||
|
||||
container.innerHTML = '';
|
||||
|
||||
menuData.forEach(category => {
|
||||
const catId = category.items.length > 0 ? category.items[0].categoryId : '';
|
||||
|
||||
const catDiv = document.createElement('div');
|
||||
catDiv.className = 'rm-category';
|
||||
catDiv.setAttribute('data-cat-id', catId);
|
||||
|
||||
let html = `<div class="restaurant-menu-category">${category.categoryName}</div>
|
||||
<div class="rmc-positions">`;
|
||||
|
||||
category.items.forEach(item => {
|
||||
html += `
|
||||
<div class="rmc-position" data-position="${item.position}" data-category-id="${item.categoryId}">
|
||||
<img class="rmc-image" src="${item.image}" alt="" loading="lazy">
|
||||
<div class="rmc-title">
|
||||
<h4>${item.title}<span>${item.description}</span></h4>
|
||||
</div>
|
||||
<div class="rmc-other"><span>${item.price}</span></div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
|
||||
html += `</div>`;
|
||||
catDiv.innerHTML = html;
|
||||
container.appendChild(catDiv);
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Błąd ładowania menu:', err);
|
||||
const container = document.getElementById('menuContainer');
|
||||
if (container) {
|
||||
container.innerHTML = '<p style="text-align:center; padding: 20px; color: var(--text-muted);">Nie udało się załadować menu.</p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Inicjalizacja ładowania menu
|
||||
loadMenu();
|
||||
|
||||
window.editCompanyData = function () {
|
||||
const n = document.getElementById("cmpName");
|
||||
const s = document.getElementById("cmpStreet");
|
||||
@@ -910,7 +959,7 @@ window.initGeolocation = function () {
|
||||
|
||||
if (dist <= MAX_DISTANCE_METERS) {
|
||||
startApp();
|
||||
setTimeout(() => showToast(`Lokalizacja zweryfikowana (Dystans: ${Math.round(dist)}m, Dokładność: ${Math.round(accuracy)}m)`), 2000);
|
||||
// setTimeout(() => showToast(`Lokalizacja zweryfikowana (Dystans: ${Math.round(dist)}m, Dokładność: ${Math.round(accuracy)}m)`), 2000);
|
||||
} else {
|
||||
geoMsg.innerHTML = `Wydaje się, że jesteś poza restauracją (ok. ${Math.round(dist)}m od nas).<br>Nasza aplikacja działa tylko na miejscu.<br><br>
|
||||
<small style="color: #888;">Debug: Twoja odległość: ${Math.round(dist)}m, Dokładność sygnału: ${Math.round(accuracy)}m</small><br><br>
|
||||
|
||||
Reference in New Issue
Block a user