#580: Loads of fixes for the field editor. Ready for production use, even with minimal features

This commit is contained in:
frikky
2021-11-23 01:22:52 +01:00
6 changed files with 19867 additions and 169 deletions
+11 -5
View File
@@ -318,11 +318,6 @@ const AngularWorkflow = (props) => {
const triggerEnvironments = isCloud ? ["cloud"] : ["onprem", "cloud"];
const unloadText = "Are you sure you want to leave without saving (CTRL+S)?";
useBeforeunload(() => {
if (!lastSaved) {
return unloadText;
}
});
const [elements, setElements] = useState([]);
// No point going as fast, as the nodes aren't realtime anymore, but bulk updated.
@@ -1950,6 +1945,17 @@ const AngularWorkflow = (props) => {
document.addEventListener("mousemove", onMouseUpdate, false);
};
useBeforeunload(() => {
if (!lastSaved) {
return unloadText;
} else {
//document.removeEventListener("mousemove", onMouseUpdate, true);
document.removeEventListener("keydown", handleKeyDown, true);
document.removeEventListener("paste", handlePaste, true);
}
});
// Nodeselectbatching:
// https://stackoverflow.com/questions/16677856/cy-onselect-callback-only-once
// onNodeClick