[Search] Tree selection syncs

Selecting something in the search results now
also makes it selected in the filetree. It
remains selected even when the search results
are cleared. (The filetree does not
automatically expand to that position though.)
This commit is contained in:
shale
2015-07-23 12:15:14 -07:00
parent 29d5535e7c
commit 2680e466fa
6 changed files with 26 additions and 55 deletions

View File

@@ -707,6 +707,9 @@ mct-container {
/* line 42, ../sass/search/_layout.scss */
.pane.treeview.left .tree-holder {
top: 0; }
/* line 47, ../sass/search/_layout.scss */
.pane.treeview.left .tree-holder.search-in-use {
display: none; }
/*****************************************************************************
* Open MCT Web, Copyright (c) 2014-2015, United States Government

View File

@@ -42,6 +42,11 @@
.tree-holder {
// Want tree holder to start right below the search bar
top: 0;
// Make tree invisible when there are things in search results
&.search-in-use {
display: none;
}
}
}
}

View File

@@ -165,7 +165,18 @@ define(
* @returns true if this should be highlighted
*/
isSelected: function () {
//return isSelected;
// Modification for compatibility with search.
// If this object is the same as the model's selected object
// Same being them having the same ID (this allows different
// instances of the same thing to be recognized as the same)
if ($scope.ngModel.selectedObject.getId() === $scope.domainObject.getId()) {
setSelection($scope.domainObject);
}
return isSelected;
// TODO: Check to make sure this change doesn't break anything.
}
};
}