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

Ignore subflow debug nodes when building filter

Fixes #1660

As the editor doesn't know the ids of subflow instance debug nodes
there's no easy way to build a list of them as part of the filter
options. So for now, disable the filter option if we don't know
about the debug node.
This commit is contained in:
Nick O'Leary 2018-03-03 22:41:02 +00:00
parent cfcf78ae28
commit 3b12076d4b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -222,7 +222,6 @@ RED.debug = (function() {
clearMessageList(false); clearMessageList(false);
}); });
return { return {
content: content, content: content,
footer: footerToolbar footer: footerToolbar
@ -238,6 +237,9 @@ RED.debug = (function() {
workspaceOrder.forEach(function(ws,i) { workspaceOrder.forEach(function(ws,i) {
workspaceOrderMap[ws] = i; workspaceOrderMap[ws] = i;
}); });
candidateNodes = candidateNodes.filter(function(node) {
return workspaceOrderMap.hasOwnProperty(node.z);
})
candidateNodes.sort(function(A,B) { candidateNodes.sort(function(A,B) {
var wsA = workspaceOrderMap[A.z]; var wsA = workspaceOrderMap[A.z];
var wsB = workspaceOrderMap[B.z]; var wsB = workspaceOrderMap[B.z];
@ -361,6 +363,15 @@ RED.debug = (function() {
menuOptionMenu.on('mouseup', function() { $(this).hide() }); menuOptionMenu.on('mouseup', function() { $(this).hide() });
menuOptionMenu.appendTo("body"); menuOptionMenu.appendTo("body");
} }
var filterOptionDisabled = false;
var sourceNode = RED.nodes.node(sourceId);
if (sourceNode && sourceNode.type !== 'debug') {
filterOptionDisabled = true;
}
RED.menu.setDisabled('debug-message-menu-item-filter',filterOptionDisabled);
RED.menu.setDisabled('debug-message-menu-item-clear-filter',filterOptionDisabled);
var elementPos = button.offset(); var elementPos = button.offset();
menuOptionMenu.css({ menuOptionMenu.css({
top: elementPos.top+"px", top: elementPos.top+"px",