updates to make generic functions work

This commit is contained in:
znetsixe
2025-07-01 17:05:09 +02:00
parent 5ca7889af1
commit a2018509ef
7 changed files with 1307 additions and 1093 deletions

View File

@@ -6,9 +6,9 @@ class PhysicalPositionMenu {
return {
positionGroups: [
{ group: 'Positional', options: [
{ value: 'upstream', label: ' Upstream' },
{ value: 'atEquipment', label: '⚙️ At Equipment' },
{ value: 'downstream', label: ' Downstream' }
{ value: 'upstream', label: ' Upstream', icon: '←'},
{ value: 'atEquipment', label: '⊥ in place' , icon: '⊥' },
{ value: 'downstream', label: ' Downstream' , icon: '→' }
]
}
]
@@ -61,6 +61,7 @@ class PhysicalPositionMenu {
const opt = document.createElement('option');
opt.value = o.value;
opt.textContent = o.label;
opt.setAttribute('data-icon', o.icon);
optg.appendChild(opt);
});
sel.appendChild(optg);
@@ -88,6 +89,8 @@ class PhysicalPositionMenu {
window.EVOLV.nodes.${nodeName}.positionMenu.saveEditor = function(node) {
const sel = document.getElementById('node-input-positionVsParent');
node.positionVsParent = sel? sel.value : 'atEquipment';
node.positionLabel = sel? sel.options[sel.selectedIndex].textContent : 'At Equipment';
node.positionIcon = sel? sel.options[sel.selectedIndex].getAttribute('data-icon') : 'fa fa-cog';
return true;
};
`;