tab memory and more stats
This commit is contained in:
parent
5b74570731
commit
4ff5a67fda
|
|
@ -19,7 +19,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
max-width: 1200px;
|
width: 90%;
|
||||||
|
max-width: 90%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
background: white;
|
background: white;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
|
@ -550,6 +551,10 @@
|
||||||
<div class="number">{{ $m1CategoriesCount }}</div>
|
<div class="number">{{ $m1CategoriesCount }}</div>
|
||||||
<div class="label">Magento 1 Categories</div>
|
<div class="label">Magento 1 Categories</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="number">{{ $m2CategoriesCount }}</div>
|
||||||
|
<div class="label">Magento 2 Categories</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -877,12 +882,35 @@ function switchTab(tabName, tabElement) {
|
||||||
document.getElementById('tab-' + tabName).classList.add('active');
|
document.getElementById('tab-' + tabName).classList.add('active');
|
||||||
tabElement.classList.add('active');
|
tabElement.classList.add('active');
|
||||||
|
|
||||||
|
// Save active tab to localStorage
|
||||||
|
localStorage.setItem('activeTab', tabName);
|
||||||
|
|
||||||
// Load category trees if switching to categories tab
|
// Load category trees if switching to categories tab
|
||||||
if (tabName === 'categories') {
|
if (tabName === 'categories') {
|
||||||
loadCategoryTrees();
|
loadCategoryTrees();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore active tab from localStorage on page load
|
||||||
|
function restoreActiveTab() {
|
||||||
|
const savedTab = localStorage.getItem('activeTab');
|
||||||
|
if (savedTab) {
|
||||||
|
// Validate that the saved tab exists
|
||||||
|
const tabContent = document.getElementById('tab-' + savedTab);
|
||||||
|
if (tabContent) {
|
||||||
|
// Find the tab button for the saved tab
|
||||||
|
const tabs = document.querySelectorAll('.tab');
|
||||||
|
tabs.forEach(tab => {
|
||||||
|
const onclick = tab.getAttribute('onclick');
|
||||||
|
if (onclick && onclick.includes(`'${savedTab}'`)) {
|
||||||
|
switchTab(savedTab, tab);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Load category trees
|
// Load category trees
|
||||||
function loadCategoryTrees() {
|
function loadCategoryTrees() {
|
||||||
loadM1Tree();
|
loadM1Tree();
|
||||||
|
|
@ -1240,6 +1268,11 @@ function cancelRenameCategory(nodeDiv, labelText, badge, renameBtn, deleteBtn) {
|
||||||
if (input) label.removeChild(input);
|
if (input) label.removeChild(input);
|
||||||
if (actionsDiv) label.removeChild(actionsDiv);
|
if (actionsDiv) label.removeChild(actionsDiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore active tab when page loads
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
restoreActiveTab();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue