[Search] Selection remains across queries

The selected object in the search results now
remains selected even after a new search is made.
It also will remain selected if it is clicked
on the file tree, but the file tree version is
not yet selected if it is clicked on the search
results list.
This commit is contained in:
shale 2015-07-23 10:56:38 -07:00
parent c65a278fcf
commit deba184103
3 changed files with 9 additions and 12 deletions

View File

@ -290,7 +290,7 @@ ul.tree {
/* line 49, ../sass/search/_search.scss */
.search-holder .search .results .search-result-item .label {
margin-left: 6px; }
/* line 58, ../sass/search/_search.scss */
/* line 53, ../sass/search/_search.scss */
.search-holder .search .results .search-result-item .label .title-label {
display: inline-block;
position: absolute;
@ -302,17 +302,17 @@ ul.tree {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
/* line 79, ../sass/search/_search.scss */
/* line 74, ../sass/search/_search.scss */
.search-holder .search .results .search-result-item.selected {
background: #005177;
color: #fff; }
/* line 83, ../sass/search/_search.scss */
/* line 78, ../sass/search/_search.scss */
.search-holder .search .results .search-result-item.selected .view-control {
color: #0099cc; }
/* line 86, ../sass/search/_search.scss */
/* line 81, ../sass/search/_search.scss */
.search-holder .search .results .search-result-item.selected .label .type-icon {
color: #fff; }
/* line 93, ../sass/search/_search.scss */
/* line 88, ../sass/search/_search.scss */
.search-holder .search .load-more-button {
margin-top: 5px;
position: relative;

View File

@ -49,12 +49,7 @@
.label {
// Give some padding away from the left side
margin-left: $leftMargin;
.type-icon {
.icon {
}
}
.title-label {
display: inline-block;
position: absolute;

View File

@ -99,7 +99,9 @@ define(function () {
*/
isSelected: function () {
// If this object is the same as the model's selected object
return $scope.ngModel.selectedObject === $scope.domainObject;
// Same being them having the same ID (this allows different
// instances of the same thing to be recognized as the same)
return $scope.ngModel.selectedObject.getId() === $scope.domainObject.getId();
}
};
}