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

Merge pull request #3745 from node-red-hitachi/fix-debug-path-menu

Fix clear pinned paths of debug sidebar menu
This commit is contained in:
Nick O'Leary 2022-07-08 08:53:24 +01:00 committed by GitHub
commit e308e02f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -459,14 +459,19 @@ RED.debug = (function() {
function showMessageMenu(button,dbgMessage,sourceId) { function showMessageMenu(button,dbgMessage,sourceId) {
activeMenuMessage = dbgMessage; activeMenuMessage = dbgMessage;
if (!menuOptionMenu) { if (!menuOptionMenu) {
menuOptionMenu = RED.menu.init({id:"red-ui-debug-msg-option-menu", var opts = [
options: [
{id:"red-ui-debug-msg-menu-item-collapse",label:RED._("node-red:debug.messageMenu.collapseAll"),onselect:function(){ {id:"red-ui-debug-msg-menu-item-collapse",label:RED._("node-red:debug.messageMenu.collapseAll"),onselect:function(){
activeMenuMessage.collapse(); activeMenuMessage.collapse();
}}, }},
];
if (activeMenuMessage.clearPinned) {
opts.push(
{id:"red-ui-debug-msg-menu-item-clear-pins",label:RED._("node-red:debug.messageMenu.clearPinned"),onselect:function(){ {id:"red-ui-debug-msg-menu-item-clear-pins",label:RED._("node-red:debug.messageMenu.clearPinned"),onselect:function(){
activeMenuMessage.clearPinned(); activeMenuMessage.clearPinned();
}}, }},
);
}
opts.push(
null, null,
{id:"red-ui-debug-msg-menu-item-filter", label:RED._("node-red:debug.messageMenu.filterNode"),onselect:function(){ {id:"red-ui-debug-msg-menu-item-filter", label:RED._("node-red:debug.messageMenu.filterNode"),onselect:function(){
var candidateNodes = RED.nodes.filterNodes({type:'debug'}); var candidateNodes = RED.nodes.filterNodes({type:'debug'});
@ -482,7 +487,10 @@ RED.debug = (function() {
$("#red-ui-sidebar-debug-filterAll").trigger("click"); $("#red-ui-sidebar-debug-filterAll").trigger("click");
refreshMessageList(); refreshMessageList();
}} }}
] );
menuOptionMenu = RED.menu.init({id:"red-ui-debug-msg-option-menu",
options: opts
}); });
menuOptionMenu.css({ menuOptionMenu.css({
position: "absolute" position: "absolute"