From 9dc49c6d0bb2133bf2df98958a07c3ff21171365 Mon Sep 17 00:00:00 2001 From: Ruben Daniels Date: Tue, 25 Aug 2015 15:46:40 -0700 Subject: [PATCH] Added ability to open filtered nodes --- plugins/c9.ide.ui/widgets.list.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/c9.ide.ui/widgets.list.js b/plugins/c9.ide.ui/widgets.list.js index 1f29e5d3..fe01d426 100644 --- a/plugins/c9.ide.ui/widgets.list.js +++ b/plugins/c9.ide.ui/widgets.list.js @@ -34,6 +34,7 @@ define(function(require, exports, module) { var acetree; var model; var redirectEvents; + var filterRoot; var meta = {}; var dataType = options.model ? "object" : options.dataType; var excludedEvents = { @@ -294,17 +295,18 @@ define(function(require, exports, module) { set filterKeyword(value){ model.keyword = value; if (!model.keyword) { + filterRoot = null; model.reKeyword = null; model.setRoot(model.cachedRoot); } else { model.reKeyword = new RegExp("(" + util.escapeRegExp(model.keyword) + ")", 'i'); - var root = search.treeSearch( + filterRoot = search.treeSearch( model.cachedRoot.items || model.cachedRoot, model.keyword, model.filterCaseInsensitive, null, null, model.indexProperty); - model.setRoot(root); + model.setRoot(filterRoot); } }, /** @@ -582,7 +584,7 @@ define(function(require, exports, module) { * */ refresh: function(){ - plugin.setRoot(plugin.root); + model.setRoot(filterRoot || plugin.root); }, /** *