Reorder group creation so groups:add is fired before nodes:change

This commit is contained in:
Nick O'Leary 2020-04-27 11:06:28 +01:00
parent 28418288e3
commit 5c0b500f48
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 4 additions and 3 deletions

View File

@ -427,15 +427,16 @@ RED.group = (function() {
h: 0, h: 0,
_def: RED.group.def _def: RED.group.def
} }
group.z = nodes[0].z;
RED.nodes.addGroup(group);
try { try {
addToGroup(group,nodes); addToGroup(group,nodes);
} catch(err) { } catch(err) {
RED.notify(err,"error"); RED.notify(err,"error");
return; return;
} }
group.z = nodes[0].z;
RED.nodes.addGroup(group);
return group; return group;
} }
function addToGroup(group,nodes) { function addToGroup(group,nodes) {