1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Track node.changed state over undo

Part of #33
This commit is contained in:
Nick O'Leary 2013-12-19 21:34:25 +00:00
parent 73f3ea52a5
commit 48d37df199
2 changed files with 3 additions and 1 deletions

View File

@ -68,6 +68,7 @@ RED.history = function() {
} }
RED.editor.validateNode(ev.node); RED.editor.validateNode(ev.node);
ev.node.dirty = true; ev.node.dirty = true;
ev.node.changed = ev.changed;
} }
RED.view.dirty(ev.dirty); RED.view.dirty(ev.dirty);
RED.view.redraw(); RED.view.redraw();

View File

@ -216,9 +216,10 @@ RED.editor = function() {
var removedLinks = updateNodeProperties(editing_node); var removedLinks = updateNodeProperties(editing_node);
if (changed) { if (changed) {
var wasChanged = editing_node.changed;
editing_node.changed = true; editing_node.changed = true;
RED.view.dirty(true); RED.view.dirty(true);
RED.history.push({t:'edit',node:editing_node,changes:changes,links:removedLinks,dirty:wasDirty}); RED.history.push({t:'edit',node:editing_node,changes:changes,links:removedLinks,dirty:wasDirty,changed:wasChanged});
} }
editing_node.dirty = true; editing_node.dirty = true;
validateNode(editing_node); validateNode(editing_node);