From dcda513901c5befd6cff5a1797199b10dab70558 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 16 Aug 2018 10:54:27 +0100 Subject: [PATCH] Prevent no-op edit of node marking as changed due to icon --- editor/js/ui/diff.js | 8 +++++++- editor/js/ui/editor.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/editor/js/ui/diff.js b/editor/js/ui/diff.js index b5af903a0..457ba5638 100644 --- a/editor/js/ui/diff.js +++ b/editor/js/ui/diff.js @@ -881,7 +881,6 @@ RED.diff = (function() { } } } - var properties = Object.keys(node).filter(function(p) { return p!='inputLabels'&&p!='outputLabels'&&p!='z'&&p!='wires'&&p!=='x'&&p!=='y'&&p!=='id'&&p!=='type'&&(!def.defaults||!def.defaults.hasOwnProperty(p))}); if (def.defaults) { properties = properties.concat(Object.keys(def.defaults)); @@ -889,6 +888,13 @@ RED.diff = (function() { if (node.type !== 'tab') { properties = properties.concat(['inputLabels','outputLabels']); } + if ( ((localNode && localNode.hasOwnProperty('icon')) || (remoteNode && remoteNode.hasOwnProperty('icon'))) && + properties.indexOf('icon') === -1 + ) { + properties.unshift('icon'); + } + + properties.forEach(function(d) { localChanged = false; remoteChanged = false; diff --git a/editor/js/ui/editor.js b/editor/js/ui/editor.js index e0445be54..46904131b 100644 --- a/editor/js/ui/editor.js +++ b/editor/js/ui/editor.js @@ -1110,7 +1110,7 @@ RED.editor = (function() { changed = true; } } else { - if (icon !== defaultIcon) { + if (icon !== "" && icon !== defaultIcon) { changes.icon = editing_node.icon; editing_node.icon = icon; changed = true;