clean up
This commit is contained in:
parent
acef61c43d
commit
c5b8a0452d
|
|
@ -1431,7 +1431,7 @@ function createTreeNode(node, source = 'm2') {
|
||||||
const labelText = document.createElement('span');
|
const labelText = document.createElement('span');
|
||||||
labelText.className = 'tree-label-text';
|
labelText.className = 'tree-label-text';
|
||||||
const productCount = node.product_count !== undefined ? node.product_count : 0;
|
const productCount = node.product_count !== undefined ? node.product_count : 0;
|
||||||
labelText.textContent = `${node.name || 'Unnamed Category'} (${productCount})`;
|
labelText.textContent = `[${node.id}] ${node.name || 'Unnamed Category'} (${productCount})`;
|
||||||
|
|
||||||
const badge = document.createElement('span');
|
const badge = document.createElement('span');
|
||||||
badge.className = `tree-badge ${node.is_active ? 'active' : 'inactive'}`;
|
badge.className = `tree-badge ${node.is_active ? 'active' : 'inactive'}`;
|
||||||
|
|
@ -1614,7 +1614,7 @@ function saveRenameCategory(nodeDiv, node, newName, source) {
|
||||||
// Update the label text
|
// Update the label text
|
||||||
const labelText = label.querySelector('.tree-label-text');
|
const labelText = label.querySelector('.tree-label-text');
|
||||||
const productCount = node.product_count !== undefined ? node.product_count : 0;
|
const productCount = node.product_count !== undefined ? node.product_count : 0;
|
||||||
labelText.textContent = `${data.new_name} (${productCount})`;
|
labelText.textContent = `[${node.id}] ${data.new_name} (${productCount})`;
|
||||||
|
|
||||||
// Restore display
|
// Restore display
|
||||||
labelText.style.display = '';
|
labelText.style.display = '';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue