From ede3ac4282578334256333e487e6817598e8807d Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Sat, 4 Feb 2023 20:55:34 +0900 Subject: [PATCH] Add tooltip for show/hide button on info sidebar --- .../@node-red/editor-client/locales/en-US/editor.json | 2 ++ .../@node-red/editor-client/locales/ja/editor.json | 2 ++ .../@node-red/editor-client/src/js/ui/tab-info-outliner.js | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json index 0300a220f..e6beed2e1 100644 --- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json @@ -683,6 +683,8 @@ "empty": "empty", "globalConfig": "Global Configuration Nodes", "triggerAction": "Trigger action", + "showFlow": "Show", + "hideFlow": "Hide", "find": "Find in workspace" }, "help": { diff --git a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json index b07b8e583..b5939cec0 100644 --- a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json @@ -683,6 +683,8 @@ "empty": "空", "globalConfig": "グローバル設定ノード", "triggerAction": "アクションを実行", + "showFlow": "表示", + "hideFlow": "非表示", "find": "ワークスペース内を検索" }, "help": { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js index 32491f297..2dc18579f 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js @@ -135,6 +135,10 @@ RED.sidebar.info.outliner = (function() { RED.workspaces.show(n.id, null, true); } }); + RED.popover.tooltip(toggleVisibleButton, function () { + var isHidden = !div.hasClass("red-ui-info-outline-item-hidden"); + return RED._("sidebar.info." + (isHidden ? "hideFlow" : "showFlow")); + }); } if (n.type !== 'subflow') { var toggleButton = $('').appendTo(controls).on("click",function(evt) {