From d273c38194240b9c4355f003a63f767b47a5dd11 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 7 Mar 2023 16:47:44 +0000 Subject: [PATCH] Fix search button in palette popover --- .../@node-red/editor-client/src/js/ui/palette.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js index 8e444b5ca..db915fd8b 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js @@ -171,23 +171,15 @@ RED.palette = (function() { } metaData += type; + const safeType = type.replace(/'/g,"\\'"); + const searchType = type.indexOf(' ') > -1 ? '"' + type + '"' : type + if (/^subflow:/.test(type)) { $('').appendTo(popOverContent) } - const safeType = type.replace(/'/g,"\\'"); - const wrapStr = function (str) { - if(str.indexOf(' ') >= 0) { - return '"' + str + '"' - } - return str - } + $('').appendTo(popOverContent) - $('') - .appendTo(popOverContent) - .on('click', function() { - RED.search.show('type:' + wrapStr(safeType)) - }) $('').appendTo(popOverContent) $('

',{style:"font-size: 0.8em"}).text(metaData).appendTo(popOverContent);