From e1c5764fbfd414c2870923f0a6240963bbdd7bc5 Mon Sep 17 00:00:00 2001 From: Steve-Mcl Date: Sat, 22 May 2021 10:52:44 +0100 Subject: [PATCH] move new inject button to existing edit form - revert refactoring of building editableList (not needed now) - remove node button modifier click & tray.show feature - add inject button to editableList [buttons] array - add `id` option to editableList to permit DOM access after creation - get the new inject button via its `id` and float it to the right - removed the popup tray buttons i18n entries --- .../src/js/ui/common/editableList.js | 5 +- .../nodes/core/common/20-inject.html | 389 +++++++----------- 2 files changed, 144 insertions(+), 250 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js index 00666e5b4..ab35f811e 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js @@ -18,7 +18,7 @@ /** * options: * - addButton : boolean|string - text for add label, default 'add' - * - buttons : array - list of custom buttons (objects with fields 'label', 'icon', 'title', 'click') + * - buttons : array - list of custom buttons (objects with fields 'id', 'label', 'icon', 'title', 'click') * - height : number|'auto' * - resize : function - called when list as a whole is resized * - resizeItem : function(item) - called to resize individual item @@ -103,6 +103,9 @@ } }); + if (button.id) { + element.attr("id", button.id); + } if (button.title) { element.attr("title", button.title); } diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html index 2052a10b8..aecb20347 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -149,7 +149,20 @@