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

Safely ignore subflow instance nodes in palette editor

This commit is contained in:
Nick O'Leary 2016-09-02 20:31:24 +01:00
parent aee483e9f1
commit 722b31edee

View File

@ -701,11 +701,13 @@ RED.palette.editor = (function() {
} }
}); });
RED.events.on('nodes:add', function(n) { RED.events.on('nodes:add', function(n) {
if (!/^subflow:/.test(n.type)) {
typesInUse[n.type] = (typesInUse[n.type]||0)+1; typesInUse[n.type] = (typesInUse[n.type]||0)+1;
if (typesInUse[n.type] === 1) { if (typesInUse[n.type] === 1) {
var ns = RED.nodes.registry.getNodeSetForType(n.type); var ns = RED.nodes.registry.getNodeSetForType(n.type);
refreshNodeModule(ns.module); refreshNodeModule(ns.module);
} }
}
}) })
RED.events.on('nodes:remove', function(n) { RED.events.on('nodes:remove', function(n) {
if (typesInUse.hasOwnProperty(n.type)) { if (typesInUse.hasOwnProperty(n.type)) {