From d9502a6c004e43adbe159e11047d03f1c7d21828 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 5 Jun 2020 22:19:46 +0100 Subject: [PATCH] Refresh outline filter whenever something changes Fixes #2601 --- .../src/js/ui/common/treeList.js | 7 ++++++- .../src/js/ui/tab-info-outliner.js | 21 ++++++++++++++++++- .../editor-client/src/sass/search.scss | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js index f11dab38d..4e7d92c37 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js @@ -346,6 +346,10 @@ },100); } that._trigger("sort",null,item); + + if (that.activeFilter) { + that.filter(that.activeFilter); + } } } item.treeList.addChild = function(newItem,select) { @@ -772,7 +776,8 @@ return undefined; } }, - filter: function(filterFunc,expandResults) { + filter: function(filterFunc) { + this.activeFilter = filterFunc; var totalCount = 0; var filter = function(item) { var matchCount = 0; 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 f9111fba8..4a8d23394 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 @@ -2,6 +2,7 @@ RED.sidebar.info.outliner = (function() { var treeList; var searchInput; + var activeSearch; var projectInfo; var projectInfoLabel; var flowList; @@ -212,6 +213,7 @@ RED.sidebar.info.outliner = (function() { var val = $(this).val(); var searchResults = RED.search.search(val); if (val) { + activeSearch = val; var resultMap = {}; for (var i=0,l=searchResults.length;i