Compare commits
5 Commits
main
...
desarrollo
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b80add102 | |||
| ad04572305 | |||
| ee7e1d49e5 | |||
| 49bbc37117 | |||
| 71f3b1cdec |
@@ -88,7 +88,8 @@
|
|||||||
.breadcrumb__link:hover { color: var(--color-primary); }
|
.breadcrumb__link:hover { color: var(--color-primary); }
|
||||||
.breadcrumb__sep { color: var(--color-text-disabled); }
|
.breadcrumb__sep { color: var(--color-text-disabled); }
|
||||||
.breadcrumb__current { color: var(--color-text-primary); font-weight: var(--font-weight-semibold); }
|
.breadcrumb__current { color: var(--color-text-primary); font-weight: var(--font-weight-semibold); }
|
||||||
|
.breadcrumb__back { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; background: transparent; border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-muted); font-size: var(--text-body-sm); cursor: pointer; transition: var(--transition-fast); }
|
||||||
|
.breadcrumb__back:hover { background: var(--color-primary-muted); color: var(--color-primary); }
|
||||||
.header-actions { display: flex; align-items: center; gap: var(--space-3); }
|
.header-actions { display: flex; align-items: center; gap: var(--space-3); }
|
||||||
|
|
||||||
/* ── Catalog mode toggle (OEM / Local) ── */
|
/* ── Catalog mode toggle (OEM / Local) ── */
|
||||||
@@ -362,13 +363,29 @@
|
|||||||
.bodega-table th { text-align: left; font-weight: var(--font-weight-semibold); color: var(--color-text-muted); font-size: var(--text-caption); text-transform: uppercase; letter-spacing: var(--tracking-wider); padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--color-border); }
|
.bodega-table th { text-align: left; font-weight: var(--font-weight-semibold); color: var(--color-text-muted); font-size: var(--text-caption); text-transform: uppercase; letter-spacing: var(--tracking-wider); padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--color-border); }
|
||||||
.bodega-table td { padding: var(--space-2); border-bottom: 1px solid var(--color-border); color: var(--color-text-primary); }
|
.bodega-table td { padding: var(--space-2); border-bottom: 1px solid var(--color-border); color: var(--color-text-primary); }
|
||||||
|
|
||||||
/* Alternatives list */
|
/* Alternatives list */
|
||||||
.alt-item { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
|
.alt-item { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
|
||||||
.alt-item:last-child { border-bottom: none; }
|
.alt-item:last-child { border-bottom: none; }
|
||||||
.alt-item__pn { font-weight: var(--font-weight-semibold); color: var(--color-text-primary); font-size: var(--text-body-sm); }
|
.alt-item__pn { font-weight: var(--font-weight-semibold); color: var(--color-text-primary); font-size: var(--text-body-sm); }
|
||||||
.alt-item__mfr { font-size: var(--text-caption); color: var(--color-text-muted); }
|
.alt-item__mfr { font-size: var(--text-caption); color: var(--color-text-muted); }
|
||||||
.alt-item__stock { font-size: var(--text-caption); }
|
.alt-item__stock { font-size: var(--text-caption); }
|
||||||
|
|
||||||
|
/* Compatible vehicles pagination */
|
||||||
|
.compat-pager {
|
||||||
|
display: flex; align-items: center; justify-content: space-between;
|
||||||
|
gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-3);
|
||||||
|
border-top: 1px solid var(--color-border);
|
||||||
|
}
|
||||||
|
.compat-pager__btn {
|
||||||
|
font-family: inherit; font-size: var(--text-caption); font-weight: var(--font-weight-semibold);
|
||||||
|
color: var(--color-text-primary); background: var(--color-surface-2);
|
||||||
|
border: 1px solid var(--color-border); border-radius: var(--radius-sm);
|
||||||
|
padding: var(--space-2) var(--space-3); cursor: pointer; white-space: nowrap;
|
||||||
|
}
|
||||||
|
.compat-pager__btn:hover:not(:disabled) { background: var(--color-surface-3, var(--color-surface-2)); }
|
||||||
|
.compat-pager__btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||||
|
.compat-pager__info { font-size: var(--text-caption); color: var(--color-text-muted); text-align: center; flex: 1; }
|
||||||
|
|
||||||
/* Add to cart section */
|
/* Add to cart section */
|
||||||
.detail-footer {
|
.detail-footer {
|
||||||
padding: var(--space-4) var(--space-5); border-top: 1px solid var(--color-border);
|
padding: var(--space-4) var(--space-5); border-top: 1px solid var(--color-border);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.el('brandCatalogOverlay').style.display = 'block';
|
this.el('brandCatalogOverlay').style.display = 'block';
|
||||||
document.body.style.overflow = 'hidden';
|
//document.body.style.overflow = 'hidden';
|
||||||
this.loadBrands();
|
this.loadBrands();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
document.body.style.overflow = '';
|
document.body.style.overflow = '';
|
||||||
this.reset();
|
this.reset();
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function() {
|
||||||
this.state = 'brands';
|
this.state = 'brands';
|
||||||
this.nav = { brand: null, brandId: null, model: null, modelId: null, year: null, yearId: null, engine: null, myeId: null, category: null, categoryId: null };
|
this.nav = { brand: null, brandId: null, model: null, modelId: null, year: null, yearId: null, engine: null, myeId: null, category: null, categoryId: null };
|
||||||
|
|||||||
@@ -276,7 +276,20 @@
|
|||||||
if (nav.nxPartType) parts.push({ label: nav.nxPartType.name, action: null });
|
if (nav.nxPartType) parts.push({ label: nav.nxPartType.name, action: null });
|
||||||
else if (nav.partType) parts.push({ label: nav.partType.name, action: null });
|
else if (nav.partType) parts.push({ label: nav.partType.name, action: null });
|
||||||
|
|
||||||
|
//Botón para retroceder
|
||||||
|
var backAction = null;
|
||||||
|
if (parts.length > 1) {
|
||||||
|
var prev = parts[parts.length - 2];
|
||||||
|
backAction = prev ? prev.action : 'loadBrands';
|
||||||
|
}
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
//Botón para retroceder
|
||||||
|
if (backAction) {
|
||||||
|
html += '<button class="breadcrumb__back" data-bc-action="' + backAction + '">← Atrás</button>';
|
||||||
|
html += '<span class="breadcrumb__sep" aria-hidden="true">|</span>';
|
||||||
|
}
|
||||||
|
//--------
|
||||||
for (var i = 0; i < parts.length; i++) {
|
for (var i = 0; i < parts.length; i++) {
|
||||||
if (i > 0) html += '<span class="breadcrumb__sep" aria-hidden="true">/</span>';
|
if (i > 0) html += '<span class="breadcrumb__sep" aria-hidden="true">/</span>';
|
||||||
if (i < parts.length - 1 && parts[i].action) {
|
if (i < parts.length - 1 && parts[i].action) {
|
||||||
@@ -303,6 +316,7 @@
|
|||||||
else if (action === 'loadNxPartTypes') { resetNavFrom('part_types'); loadNexpartPartTypes(); }
|
else if (action === 'loadNxPartTypes') { resetNavFrom('part_types'); loadNexpartPartTypes(); }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetNav() {
|
function resetNav() {
|
||||||
@@ -1258,10 +1272,8 @@
|
|||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compatibilities — deduplicate by (make, model, year, engine)
|
// Compatibilities — deduplicate by (make, model, year, engine)
|
||||||
if (p.compatibilities && p.compatibilities.length) {
|
if (p.compatibilities && p.compatibilities.length) {
|
||||||
html += '<div class="detail-section">';
|
|
||||||
html += '<div class="detail-section__title">Vehiculos compatibles</div>';
|
|
||||||
var seenCompat = {};
|
var seenCompat = {};
|
||||||
var uniqCompat = [];
|
var uniqCompat = [];
|
||||||
p.compatibilities.forEach(function(c) {
|
p.compatibilities.forEach(function(c) {
|
||||||
@@ -1270,22 +1282,69 @@
|
|||||||
seenCompat[key] = true;
|
seenCompat[key] = true;
|
||||||
uniqCompat.push(c);
|
uniqCompat.push(c);
|
||||||
});
|
});
|
||||||
var currentMake = '';
|
html += '<div class="detail-section">';
|
||||||
uniqCompat.forEach(function(c) {
|
html += '<div class="detail-section__title">Vehiculos compatibles</div>';
|
||||||
if (c.make !== currentMake) {
|
html += '<div id="compat-list"></div>';
|
||||||
currentMake = c.make;
|
html += '<div id="compat-pager" class="compat-pager"></div>';
|
||||||
html += '<div style="font-weight:600;margin-top:8px;">' + esc(c.make) + '</div>';
|
|
||||||
}
|
|
||||||
html += '<div style="padding-left:12px;color:var(--color-text-muted);font-size:var(--text-body-sm);">' +
|
|
||||||
esc(c.model) + ' ' + c.year + ' ' + esc(c.engine || '') + '</div>';
|
|
||||||
});
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
compatFullList = uniqCompat;
|
||||||
|
} else {
|
||||||
|
compatFullList = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
detailBody.innerHTML = html;
|
detailBody.innerHTML = html;
|
||||||
|
|
||||||
|
if (compatFullList.length) {
|
||||||
|
renderCompatPage(1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Pagination for "Vehiculos compatibles" ---
|
||||||
|
var compatFullList = [];
|
||||||
|
var compatPageSize = 15;
|
||||||
|
var compatCurrentPage = 1;
|
||||||
|
|
||||||
|
function renderCompatPage(page) {
|
||||||
|
var listEl = document.getElementById('compat-list');
|
||||||
|
var pagerEl = document.getElementById('compat-pager');
|
||||||
|
if (!listEl || !pagerEl) return;
|
||||||
|
|
||||||
|
var totalItems = compatFullList.length;
|
||||||
|
var totalPages = Math.max(1, Math.ceil(totalItems / compatPageSize));
|
||||||
|
page = Math.min(Math.max(1, page), totalPages);
|
||||||
|
compatCurrentPage = page;
|
||||||
|
|
||||||
|
var start = (page - 1) * compatPageSize;
|
||||||
|
var pageItems = compatFullList.slice(start, start + compatPageSize);
|
||||||
|
|
||||||
|
var listHtml = '';
|
||||||
|
var currentMake = '';
|
||||||
|
pageItems.forEach(function(c) {
|
||||||
|
if (c.make !== currentMake) {
|
||||||
|
currentMake = c.make;
|
||||||
|
listHtml += '<div style="font-weight:600;margin-top:8px;">' + esc(c.make) + '</div>';
|
||||||
|
}
|
||||||
|
listHtml += '<div style="padding-left:12px;color:var(--color-text-muted);font-size:var(--text-body-sm);">' +
|
||||||
|
esc(c.model) + ' ' + c.year + ' ' + esc(c.engine || '') + '</div>';
|
||||||
|
});
|
||||||
|
listEl.innerHTML = listHtml;
|
||||||
|
|
||||||
|
if (totalPages > 1) {
|
||||||
|
pagerEl.innerHTML =
|
||||||
|
'<button type="button" id="compat-prev" class="compat-pager__btn"' + (page <= 1 ? ' disabled' : '') + '>‹ Anterior</button>' +
|
||||||
|
'<span class="compat-pager__info">Pagina ' + page + ' de ' + totalPages + ' (' + totalItems + ' vehiculos)</span>' +
|
||||||
|
'<button type="button" id="compat-next" class="compat-pager__btn"' + (page >= totalPages ? ' disabled' : '') + '>Siguiente ›</button>';
|
||||||
|
|
||||||
|
var prevBtn = document.getElementById('compat-prev');
|
||||||
|
var nextBtn = document.getElementById('compat-next');
|
||||||
|
if (prevBtn) prevBtn.addEventListener('click', function () { renderCompatPage(compatCurrentPage - 1); });
|
||||||
|
if (nextBtn) nextBtn.addEventListener('click', function () { renderCompatPage(compatCurrentPage + 1); });
|
||||||
|
} else {
|
||||||
|
pagerEl.innerHTML = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function closeDetail() {
|
function closeDetail() {
|
||||||
detailPanel.classList.remove('is-open');
|
detailPanel.classList.remove('is-open');
|
||||||
detailOverlay.classList.remove('is-visible');
|
detailOverlay.classList.remove('is-visible');
|
||||||
@@ -1788,20 +1847,22 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function vsYearChanged() {
|
function vsYearChanged() {
|
||||||
var yearId = vsYear.value;
|
var yearId = vsYear.value;
|
||||||
vsBrand.innerHTML = '<option value="">Marca...</option>';
|
vsClear.style.display = (yearId || vsBrand.value || vsModel.value) ? '' : 'none';
|
||||||
vsModel.innerHTML = '<option value="">Modelo...</option>';
|
|
||||||
vsEngine.innerHTML = '<option value="">Motor...</option>';
|
|
||||||
vsBrand.disabled = true;
|
|
||||||
vsModel.disabled = true;
|
|
||||||
vsEngine.disabled = true;
|
|
||||||
vsClear.style.display = yearId ? '' : 'none';
|
|
||||||
|
|
||||||
if (!yearId) return;
|
// Resetear marca solo si no hay nada seleccionado en ella
|
||||||
|
|
||||||
// Load brands filtered by year
|
|
||||||
vsBrand.disabled = false;
|
vsBrand.disabled = false;
|
||||||
|
vsEngine.innerHTML = '<option value="">Motor...</option>';
|
||||||
|
vsEngine.disabled = true;
|
||||||
|
|
||||||
|
if (!yearId) {
|
||||||
|
//carga todo
|
||||||
|
vsLoadAllBrands();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Filtrar marcas por año
|
||||||
apiFetch(API + '/brands?year_id=' + yearId + '&mode=' + catalogMode).then(function (data) {
|
apiFetch(API + '/brands?year_id=' + yearId + '&mode=' + catalogMode).then(function (data) {
|
||||||
var brands = data.data || data;
|
var brands = data.data || data;
|
||||||
if (!brands) return;
|
if (!brands) return;
|
||||||
@@ -1809,21 +1870,39 @@
|
|||||||
brands.map(function (b) {
|
brands.map(function (b) {
|
||||||
return '<option value="' + b.id_brand + '">' + esc(b.name_brand) + '</option>';
|
return '<option value="' + b.id_brand + '">' + esc(b.name_brand) + '</option>';
|
||||||
}).join('');
|
}).join('');
|
||||||
|
// si hay marca seleccionada despliega modelos
|
||||||
|
if (vsBrand.value) vsBrandChanged();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function vsLoadAllBrands() {
|
||||||
|
apiFetch(API + '/brands?mode=' + catalogMode).then(function (data) {
|
||||||
|
var brands = data.data || data;
|
||||||
|
if (!brands) return;
|
||||||
|
var current = vsBrand.value;
|
||||||
|
vsBrand.innerHTML = '<option value="">Marca...</option>' +
|
||||||
|
brands.map(function (b) {
|
||||||
|
return '<option value="' + b.id_brand + '">' + esc(b.name_brand) + '</option>';
|
||||||
|
}).join('');
|
||||||
|
if (current) vsBrand.value = current;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function vsBrandChanged() {
|
function vsBrandChanged() {
|
||||||
var brandId = vsBrand.value;
|
var brandId = vsBrand.value;
|
||||||
var yearId = vsYear.value;
|
var yearId = vsYear.value;
|
||||||
|
vsClear.style.display = (yearId || brandId) ? '' : 'none';
|
||||||
|
|
||||||
vsModel.innerHTML = '<option value="">Modelo...</option>';
|
vsModel.innerHTML = '<option value="">Modelo...</option>';
|
||||||
vsEngine.innerHTML = '<option value="">Motor...</option>';
|
vsEngine.innerHTML = '<option value="">Motor...</option>';
|
||||||
vsModel.disabled = true;
|
vsModel.disabled = false; // cambio
|
||||||
vsEngine.disabled = true;
|
vsEngine.disabled = true;
|
||||||
|
|
||||||
if (!brandId) return;
|
if (!brandId) {
|
||||||
|
vsModel.disabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Load models filtered by brand AND year
|
// Cargar modelos con o sin año
|
||||||
vsModel.disabled = false;
|
|
||||||
apiFetch(API + '/models?brand_id=' + brandId + (yearId ? '&year_id=' + yearId : '')).then(function (data) {
|
apiFetch(API + '/models?brand_id=' + brandId + (yearId ? '&year_id=' + yearId : '')).then(function (data) {
|
||||||
var models = data.data || data;
|
var models = data.data || data;
|
||||||
if (!models) return;
|
if (!models) return;
|
||||||
@@ -1831,32 +1910,53 @@
|
|||||||
models.map(function (m) {
|
models.map(function (m) {
|
||||||
return '<option value="' + m.id_model + '">' + esc(m.display_name || m.name_model) + '</option>';
|
return '<option value="' + m.id_model + '">' + esc(m.display_name || m.name_model) + '</option>';
|
||||||
}).join('');
|
}).join('');
|
||||||
|
// si hay modelo seleccionado despliega año
|
||||||
|
if (vsModel.value) vsModelChanged();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function vsModelChanged() {
|
function vsModelChanged() {
|
||||||
var modelId = vsModel.value;
|
var modelId = vsModel.value;
|
||||||
var yearVal = vsYear.value;
|
var yearVal = vsYear.value;
|
||||||
|
|
||||||
vsEngine.innerHTML = '<option value="">Motor...</option>';
|
vsEngine.innerHTML = '<option value="">Motor...</option>';
|
||||||
vsEngine.disabled = true;
|
vsEngine.disabled = true;
|
||||||
|
|
||||||
if (!modelId || !yearVal) return;
|
if (!modelId) return;
|
||||||
|
|
||||||
vsEngine.disabled = false;
|
// Si hay año carga motores
|
||||||
apiFetch(API + '/engines?model_id=' + modelId + '&year_id=' + yearVal).then(function (data) {
|
if (yearVal) {
|
||||||
var engines = data.data || data;
|
vsEngine.disabled = false;
|
||||||
if (!engines) return;
|
apiFetch(API + '/engines?model_id=' + modelId + '&year_id=' + yearVal).then(function (data) {
|
||||||
vsEngine.innerHTML = '<option value="">Motor...</option>' +
|
var engines = data.data || data;
|
||||||
engines.map(function (e) {
|
if (!engines) return;
|
||||||
var label = e.name_engine + (e.trim_level ? ' (' + e.trim_level + ')' : '');
|
vsEngine.innerHTML = '<option value="">Motor...</option>' +
|
||||||
return '<option value="' + e.id_mye + '">' + esc(label) + '</option>';
|
engines.map(function (e) {
|
||||||
}).join('');
|
var label = e.name_engine + (e.trim_level ? ' (' + e.trim_level + ')' : '');
|
||||||
// If only 1 engine, auto-select
|
return '<option value="' + e.id_mye + '">' + esc(label) + '</option>';
|
||||||
if (engines.length === 1) {
|
}).join('');
|
||||||
vsEngine.value = engines[0].id_mye;
|
if (engines.length === 1) {
|
||||||
vsEngineChanged();
|
vsEngine.value = engines[0].id_mye;
|
||||||
}
|
vsEngineChanged();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Sin año
|
||||||
|
var brandId = vsBrand.value;
|
||||||
|
if (!brandId) return;
|
||||||
|
nav.brand = { id: parseInt(brandId), name: vsBrand.options[vsBrand.selectedIndex].text };
|
||||||
|
nav.model = { id: parseInt(modelId), name: vsModel.options[vsModel.selectedIndex].text };
|
||||||
|
nav.year = null;
|
||||||
|
nav.engine = null;
|
||||||
|
nav.level = 'categories';
|
||||||
|
pushNavState();
|
||||||
|
loadCategoriesForMode();
|
||||||
|
setTimeout(function () {
|
||||||
|
var body = document.getElementById('pageBody');
|
||||||
|
if (body) body.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function vsEngineChanged() {
|
function vsEngineChanged() {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const Config = (() => {
|
|||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
document.documentElement.setAttribute('data-theme', theme);
|
document.documentElement.setAttribute('data-theme', theme);
|
||||||
try { localStorage.setItem('nexus-theme', theme); } catch(e) {}
|
try { localStorage.setItem('pos_theme', theme); } catch(e) {}
|
||||||
|
|
||||||
document.querySelectorAll('.theme-btn').forEach(function(btn) {
|
document.querySelectorAll('.theme-btn').forEach(function(btn) {
|
||||||
btn.classList.toggle('is-active', btn.dataset.themeTarget === theme);
|
btn.classList.toggle('is-active', btn.dataset.themeTarget === theme);
|
||||||
@@ -802,7 +802,7 @@ const Config = (() => {
|
|||||||
|
|
||||||
// Restore theme
|
// Restore theme
|
||||||
try {
|
try {
|
||||||
var saved = localStorage.getItem('nexus-theme');
|
var saved = localStorage.getItem('pos_theme');
|
||||||
if (saved === 'industrial' || saved === 'modern') {
|
if (saved === 'industrial' || saved === 'modern') {
|
||||||
setTheme(saved);
|
setTheme(saved);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const Dashboard = (() => {
|
|||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
document.documentElement.setAttribute('data-theme', theme);
|
document.documentElement.setAttribute('data-theme', theme);
|
||||||
try { localStorage.setItem('nexus-theme', theme); } catch(e) {}
|
try { localStorage.setItem('pos_theme', theme); } catch(e) {}
|
||||||
const btnInd = document.getElementById('btn-industrial');
|
const btnInd = document.getElementById('btn-industrial');
|
||||||
const btnMod = document.getElementById('btn-modern');
|
const btnMod = document.getElementById('btn-modern');
|
||||||
if (btnInd) btnInd.classList.toggle('active', theme === 'industrial');
|
if (btnInd) btnInd.classList.toggle('active', theme === 'industrial');
|
||||||
@@ -689,7 +689,7 @@ const Dashboard = (() => {
|
|||||||
|
|
||||||
// Restore theme
|
// Restore theme
|
||||||
try {
|
try {
|
||||||
const saved = localStorage.getItem('nexus-theme');
|
const saved = localStorage.getItem('pos_theme');
|
||||||
if (saved === 'industrial' || saved === 'modern') {
|
if (saved === 'industrial' || saved === 'modern') {
|
||||||
setTheme(saved);
|
setTheme(saved);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const Reports = (() => {
|
|||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
document.documentElement.setAttribute('data-theme', theme);
|
document.documentElement.setAttribute('data-theme', theme);
|
||||||
try { localStorage.setItem('nexus-theme', theme); } catch(e) {}
|
try { localStorage.setItem('pos_theme', theme); } catch(e) {}
|
||||||
var btnInd = document.getElementById('btn-industrial');
|
var btnInd = document.getElementById('btn-industrial');
|
||||||
var btnMod = document.getElementById('btn-modern');
|
var btnMod = document.getElementById('btn-modern');
|
||||||
if (btnInd) btnInd.classList.toggle('is-active', theme === 'industrial');
|
if (btnInd) btnInd.classList.toggle('is-active', theme === 'industrial');
|
||||||
@@ -745,7 +745,7 @@ const Reports = (() => {
|
|||||||
|
|
||||||
// Restore theme
|
// Restore theme
|
||||||
try {
|
try {
|
||||||
var saved = localStorage.getItem('nexus-theme') || 'industrial';
|
var saved = localStorage.getItem('pos_theme') || 'industrial';
|
||||||
setTheme(saved);
|
setTheme(saved);
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
|
|||||||
@@ -145,14 +145,14 @@
|
|||||||
<div class="vs-arrow">›</div>
|
<div class="vs-arrow">›</div>
|
||||||
<div class="vs-group">
|
<div class="vs-group">
|
||||||
<label class="vs-label">Marca</label>
|
<label class="vs-label">Marca</label>
|
||||||
<select class="vs-select" id="vsBrand" disabled onchange="CatalogApp.vsBrandChanged()">
|
<select class="vs-select" id="vsBrand" onchange="CatalogApp.vsBrandChanged()">
|
||||||
<option value="">Seleccionar...</option>
|
<option value="">Seleccionar...</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="vs-arrow">›</div>
|
<div class="vs-arrow">›</div>
|
||||||
<div class="vs-group">
|
<div class="vs-group">
|
||||||
<label class="vs-label">Modelo</label>
|
<label class="vs-label">Modelo</label>
|
||||||
<select class="vs-select" id="vsModel" disabled onchange="CatalogApp.vsModelChanged()">
|
<select class="vs-select" id="vsModel" onchange="CatalogApp.vsModelChanged()">
|
||||||
<option value="">Seleccionar...</option>
|
<option value="">Seleccionar...</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -302,7 +302,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Brand Catalog Overlay (full-screen overlay for brand-first browsing) -->
|
<!-- Brand Catalog Overlay (full-screen overlay for brand-first browsing) -->
|
||||||
<div id="brandCatalogOverlay" style="display:none;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9000;background:var(--color-bg-base);overflow:auto;padding:var(--space-4);">
|
<div id="brandCatalogOverlay" style="display:none;position:relative;top:0;left:0;right:0;bottom:0;background:var(--color-bg-base);overflow:auto;padding:var(--space-4);">
|
||||||
<div style="max-width:1200px;margin:0 auto;">
|
<div style="max-width:1200px;margin:0 auto;">
|
||||||
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-4);">
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--space-4);">
|
||||||
<h2 style="margin:0;font-family:var(--font-heading);font-size:var(--text-h3);">Catalogo por Marca</h2>
|
<h2 style="margin:0;font-family:var(--font-heading);font-size:var(--text-h3);">Catalogo por Marca</h2>
|
||||||
|
|||||||
@@ -644,13 +644,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Persist preference
|
// Persist preference
|
||||||
try { localStorage.setItem('nexus-theme', theme); } catch(e) {}
|
try { localStorage.setItem('pos_theme', theme); } catch(e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore on load
|
// Restore on load
|
||||||
(function() {
|
(function() {
|
||||||
var saved;
|
var saved;
|
||||||
try { saved = localStorage.getItem('nexus-theme'); } catch(e) {}
|
try { saved = localStorage.getItem('pos_theme'); } catch(e) {}
|
||||||
if (saved === 'industrial' || saved === 'modern') {
|
if (saved === 'industrial' || saved === 'modern') {
|
||||||
setTheme(saved);
|
setTheme(saved);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user