|
|
|
(function() { |
|
|
|
|
|
|
|
setInterval(function() { |
|
|
|
if (window.draggedNode !== undefined) { |
|
delete window.draggedNode; |
|
} |
|
|
|
|
|
if (document.querySelectorAll('.temp-connection').length > 0 && |
|
!document.querySelector('.node-port.active-port')) { |
|
document.querySelectorAll('.temp-connection').forEach(el => { |
|
if (el.parentNode) { |
|
el.parentNode.removeChild(el); |
|
} |
|
}); |
|
} |
|
|
|
|
|
const activePorts = document.querySelectorAll('.active-port, .valid-target, .invalid-target, .port-hover'); |
|
if (activePorts.length > 0 && document.querySelectorAll('.temp-connection').length === 0) { |
|
activePorts.forEach(port => { |
|
port.classList.remove('active-port', 'valid-target', 'invalid-target', 'port-hover'); |
|
}); |
|
} |
|
|
|
|
|
if (!document.querySelector('.dragging')) { |
|
document.body.classList.remove('node-dragging'); |
|
} |
|
}, 5000); |
|
|
|
|
|
['mouseup', 'dragend'].forEach(eventName => { |
|
document.addEventListener(eventName, function() { |
|
|
|
setTimeout(function() { |
|
if (window.draggedNode !== undefined) { |
|
delete window.draggedNode; |
|
} |
|
}, 100); |
|
}); |
|
}); |
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
document.querySelectorAll('.dragging').forEach(node => { |
|
node.classList.remove('dragging'); |
|
}); |
|
document.body.classList.remove('node-dragging'); |
|
|
|
|
|
document.querySelectorAll('.canvas-node').forEach(node => { |
|
node.style.zIndex = '10'; |
|
}); |
|
}); |
|
})(); |