mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 15:34:26 +01:00
Add user setting for showing the node info icon
This commit is contained in:
@@ -111,6 +111,7 @@
|
||||
"userSettings": "User Settings",
|
||||
"nodes": "Nodes",
|
||||
"displayStatus": "Show node status",
|
||||
"displayInfoIcon": "Show node information icon",
|
||||
"displayConfig": "Configuration nodes",
|
||||
"import": "Import",
|
||||
"importExample": "Import example flow",
|
||||
|
||||
@@ -140,6 +140,7 @@ RED.userSettings = (function() {
|
||||
title: "menu.label.nodes",
|
||||
options: [
|
||||
{setting:"view-node-status",oldSetting:"menu-menu-item-status",label:"menu.label.displayStatus",default: true, toggle:true,onchange:"core:toggle-status"},
|
||||
{setting:"view-node-info-icon", label:"menu.label.displayInfoIcon", default: true, toggle:true,onchange:"core:toggle-node-info-icon"},
|
||||
{setting:"view-node-show-label",label:"menu.label.showNodeLabelDefault",default: true, toggle:true}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -82,6 +82,7 @@ RED.view = (function() {
|
||||
var slicePathLast = null;
|
||||
var ghostNode = null;
|
||||
var showStatus = false;
|
||||
let showNodeInfo = true;
|
||||
var lastClickNode = null;
|
||||
var dblClickPrimed = null;
|
||||
var clickTime = 0;
|
||||
@@ -860,6 +861,13 @@ RED.view = (function() {
|
||||
toggleStatus(state);
|
||||
}
|
||||
});
|
||||
RED.actions.add("core:toggle-node-info-icon", function (state) {
|
||||
if (state === undefined) {
|
||||
RED.userSettings.toggle("view-node-info-icon");
|
||||
} else {
|
||||
toggleNodeInfo(state)
|
||||
}
|
||||
})
|
||||
|
||||
RED.view.annotations.init();
|
||||
RED.view.navigator.init();
|
||||
@@ -896,7 +904,7 @@ RED.view = (function() {
|
||||
|
||||
return docsBadge;
|
||||
},
|
||||
show: function(n) { return !!n.info }
|
||||
show: function(n) { return showNodeInfo && !!n.info }
|
||||
})
|
||||
|
||||
RED.view.annotations.register("red-ui-flow-node-changed",{
|
||||
@@ -6040,6 +6048,11 @@ RED.view = (function() {
|
||||
//TODO: subscribe/unsubscribe here
|
||||
redraw();
|
||||
}
|
||||
function toggleNodeInfo(s) {
|
||||
showNodeInfo = s
|
||||
RED.nodes.eachNode(function(n) { n.dirty = true;});
|
||||
redraw();
|
||||
}
|
||||
function setSelectedNodeState(isDisabled) {
|
||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user