aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelijahe2013-12-05 12:46:13 (EST)
committerSilenio Quarti2013-12-06 16:22:39 (EST)
commit35b50f4bc7ae05fc7555359d794b8d9d5c889656 (patch)
treed9f05d5052f6d76028e9d8595dfe6e1947c8e52c
parent8a49f3ed01fd462f6a89d095964905a6513ba606 (diff)
downloadorg.eclipse.orion.client-35b50f4bc7ae05fc7555359d794b8d9d5c889656.zip
org.eclipse.orion.client-35b50f4bc7ae05fc7555359d794b8d9d5c889656.tar.gz
org.eclipse.orion.client-35b50f4bc7ae05fc7555359d794b8d9d5c889656.tar.bz2
Bug 422499 - Filtering for outliner does not find non-visible items
- Part1 of fix, missing parents of leaf items --Signed-off-by: Elijah El-Haddad <elijahe@ca.ibm.com>
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/outliner.js16
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/webui/treetable.js3
2 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js b/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js
index 9c149b1..5af7ab9 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/outliner.js
@@ -111,6 +111,7 @@ define([
OutlineExplorer.prototype = new mExplorer.Explorer();
OutlineExplorer.prototype.constructor = OutlineExplorer;
+ var previousFilter = null;
OutlineExplorer.prototype.filterChanged = function (filter) {
var navHandler = this.getNavHandler();
@@ -122,6 +123,16 @@ define([
var modifiedFilter = "^" + filter.replace(/([.+^=!:${}()|\[\]\/\\])/g, "\\$1"); //add start of line character and escape all special characters except * and ?
modifiedFilter = modifiedFilter.replace(/([*?])/g, ".$1"); //convert user input * and ? to .* and .?
+ if (previousFilter) {
+ if (0 !== filter.indexOf(previousFilter)) {
+ //this is not a more specific version of the previous filter, expand again
+ this.expandAll();
+ }
+ } else {
+ //previous filter not defined, expand all
+ this.expandAll();
+ }
+
for (var id in itemMap) {
if (itemMap.hasOwnProperty(id)) {
item = itemMap[id];
@@ -131,11 +142,14 @@ define([
item.isHidden = true;
} else {
//label matches filter, show row
+ //TODO show parent rows also
navHandler.getRowDiv(item).classList.remove("outlineRowHidden"); //$NON-NLS-0$
item.isHidden = false;
}
}
- }
+ }
+
+ previousFilter = filter;
};
function OutlineModel(items, rootId) {
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/treetable.js b/bundles/org.eclipse.orion.client.ui/web/orion/webui/treetable.js
index 21f50d0..f3a08f3 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/treetable.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/webui/treetable.js
@@ -247,9 +247,6 @@ define(['i18n!orion/nls/messages', 'orion/webui/littlelib'], function(messages,
var id = typeof(itemOrId) === "string" ? itemOrId : this._treeModel.getId(itemOrId); //$NON-NLS-0$
var row = lib.node(id);
if (row) {
- if (row._expanded) {
- return;
- }
var tree = this;
this._renderer.updateExpandVisuals(row, "progress"); //$NON-NLS-0$
this._treeModel.getChildren(row._item, function(children) {