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

Emit nodes:change event for config node users list modified

This commit is contained in:
Nick O'Leary 2020-06-15 22:16:48 +01:00
parent e3c8466819
commit 5b1fe9aa0a
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 8 additions and 0 deletions

View File

@ -331,10 +331,12 @@ RED.history = (function() {
var currentConfigNode = RED.nodes.node(ev.node[i]);
if (currentConfigNode) {
currentConfigNode.users.splice(currentConfigNode.users.indexOf(ev.node),1);
RED.events.emit("nodes:change",currentConfigNode);
}
var newConfigNode = RED.nodes.node(ev.changes[i]);
if (newConfigNode) {
newConfigNode.users.push(ev.node);
RED.events.emit("nodes:change",newConfigNode);
}
}
ev.node[i] = ev.changes[i];

View File

@ -1283,10 +1283,12 @@ RED.editor = (function() {
if (configNode) {
var users = configNode.users;
users.splice(users.indexOf(editing_node),1);
RED.events.emit("nodes:change",configNode);
}
configNode = RED.nodes.node(newValue);
if (configNode) {
configNode.users.push(editing_node);
RED.events.emit("nodes:change",configNode);
}
}
changes[d] = editing_node[d];
@ -1911,10 +1913,12 @@ RED.editor = (function() {
if (configNode) {
var users = configNode.users;
users.splice(users.indexOf(editing_config_node),1);
RED.events.emit("nodes:change",configNode);
}
configNode = RED.nodes.node(newValue);
if (configNode) {
configNode.users.push(editing_config_node);
RED.events.emit("nodes:change",configNode);
}
}
editing_config_node[d] = newValue;
@ -2503,10 +2507,12 @@ RED.editor = (function() {
if (configNode) {
var users = configNode.users;
users.splice(users.indexOf(editing_node),1);
RED.events.emit("nodes:change",configNode);
}
configNode = RED.nodes.node(newValue);
if (configNode) {
configNode.users.push(editing_node);
RED.events.emit("nodes:change",configNode);
}
}
changes[d] = editing_node[d];