I can save workflow state + uptated css + started Properties Panek
This commit is contained in:
@@ -206,6 +206,20 @@ function bindWorkflowDesigner(elementId) {
|
||||
designer.connectionStart = null;
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
const component = event.target.closest('.wkf-workflow-component');
|
||||
componentId = component ? component.dataset.componentId : null
|
||||
htmx.ajax('POST', '/workflows/select-connection', {
|
||||
target: `#c_${elementId}`,
|
||||
headers: {"Content-Type": "application/x-www-form-urlencoded"},
|
||||
swap: "innerHTML",
|
||||
values: {
|
||||
_id: elementId,
|
||||
component_id: componentId
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Canvas drag over event (for dropping new components)
|
||||
@@ -270,9 +284,9 @@ function bindWorkflowDesigner(elementId) {
|
||||
if (!fromComp || !toComp) return;
|
||||
// Get current positions
|
||||
const fromX = parseInt(fromComp.style.left) + 128; // component width + output point
|
||||
const fromY = parseInt(fromComp.style.top) + 40; // component height / 2
|
||||
const fromY = parseInt(fromComp.style.top) + 32; // component height / 2
|
||||
const toX = parseInt(toComp.style.left);
|
||||
const toY = parseInt(toComp.style.top) + 40;
|
||||
const toY = parseInt(toComp.style.top) + 32;
|
||||
// Create curved path
|
||||
const midX = (fromX + toX) / 2;
|
||||
const path = `M ${fromX} ${fromY} C ${midX} ${fromY}, ${midX} ${toY}, ${toX} ${toY}`;
|
||||
|
||||
Reference in New Issue
Block a user