mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
5 Commits
4651-in-ou
...
undo-histo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c294532152 | ||
|
|
960af87fb0 | ||
|
|
de7339ae97 | ||
|
|
0995af62b6 | ||
|
|
c2e03a40b4 |
@@ -706,11 +706,36 @@ RED.history = (function() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function markEventDirty (evt) {
|
||||||
|
// This isn't 100% thorough - just covers the main move/edit/delete cases
|
||||||
|
evt.dirty = true
|
||||||
|
if (evt.multi) {
|
||||||
|
for (let i = 0; i < evt.events.length-1; i++) {
|
||||||
|
markEventDirty(evt.events[i])
|
||||||
|
}
|
||||||
|
} else if (evt.t === 'move') {
|
||||||
|
for (let i=0;i<evt.nodes.length;i++) {
|
||||||
|
evt.nodes[i].moved = true
|
||||||
|
}
|
||||||
|
} else if (evt.t === 'edit') {
|
||||||
|
evt.changed = true
|
||||||
|
} else if (evt.t === 'delete') {
|
||||||
|
if (evt.nodes) {
|
||||||
|
for (let i=0;i<evt.nodes.length;i++) {
|
||||||
|
evt.nodes[i].changed = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
//TODO: this function is a placeholder until there is a 'save' event that can be listened to
|
|
||||||
markAllDirty: function() {
|
markAllDirty: function() {
|
||||||
for (var i=0;i<undoHistory.length;i++) {
|
// A deploy has happened meaning any undo into the history will represent
|
||||||
|
// an undeployed change - regardless of what it was when the event was recorded.
|
||||||
|
// This goes back through the history any marks them all as being dirty events
|
||||||
|
// and also ensures individual node states are marked dirty
|
||||||
|
for (let i=0;i<undoHistory.length;i++) {
|
||||||
undoHistory[i].dirty = true;
|
undoHistory[i].dirty = true;
|
||||||
|
markEventDirty(undoHistory[i])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
list: function() {
|
list: function() {
|
||||||
|
|||||||
@@ -612,7 +612,10 @@ RED.deploy = (function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
RED.nodes.eachSubflow(function (subflow) {
|
RED.nodes.eachSubflow(function (subflow) {
|
||||||
|
if (subflow.changed) {
|
||||||
subflow.changed = false;
|
subflow.changed = false;
|
||||||
|
RED.events.emit("subflows:change", subflow);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
RED.nodes.eachWorkspace(function (ws) {
|
RED.nodes.eachWorkspace(function (ws) {
|
||||||
if (ws.changed || ws.added) {
|
if (ws.changed || ws.added) {
|
||||||
|
|||||||
@@ -1623,8 +1623,8 @@ RED.editor = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isSameObj(old_env, new_env)) {
|
if (!isSameObj(old_env, new_env)) {
|
||||||
editing_node.env = new_env;
|
|
||||||
editState.changes.env = editing_node.env;
|
editState.changes.env = editing_node.env;
|
||||||
|
editing_node.env = new_env;
|
||||||
editState.changed = true;
|
editState.changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2167,9 +2167,9 @@ RED.view = (function() {
|
|||||||
if (n.ox !== n.n.x || n.oy !== n.n.y || addedToGroup) {
|
if (n.ox !== n.n.x || n.oy !== n.n.y || addedToGroup) {
|
||||||
// This node has moved or added to a group
|
// This node has moved or added to a group
|
||||||
if (rehomedNodes.has(n)) {
|
if (rehomedNodes.has(n)) {
|
||||||
moveAndChangedGroupEvent.nodes.push({...n})
|
moveAndChangedGroupEvent.nodes.push({...n, moved: n.n.moved})
|
||||||
} else {
|
} else {
|
||||||
moveEvent.nodes.push({...n})
|
moveEvent.nodes.push({...n, moved: n.n.moved})
|
||||||
}
|
}
|
||||||
n.n.dirty = true;
|
n.n.dirty = true;
|
||||||
n.n.moved = true;
|
n.n.moved = true;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
<h4>Automatic mode</h4>
|
<h4>Automatic mode</h4>
|
||||||
<p>Automatic mode uses the <code>parts</code> property of incoming messages to
|
<p>Automatic mode uses the <code>parts</code> property of incoming messages to
|
||||||
determine how the sequence should be joined. This allows it to automatically
|
determine how the sequence should be joined. This allows it to automatically
|
||||||
reverse the action of a <b>split</b> node.
|
reverse the action of a <b>split</b> node.</p>
|
||||||
|
|
||||||
<h4>Manual mode</h4>
|
<h4>Manual mode</h4>
|
||||||
<p>When configured to join in manual mode, the node is able to join sequences
|
<p>When configured to join in manual mode, the node is able to join sequences
|
||||||
|
|||||||
Reference in New Issue
Block a user