WIP: add open/closed folders icons for dash search

If browsing, then show open folder icon. If searching, show
the closed folder icon
This commit is contained in:
Daniel Lee
2017-06-12 15:49:09 +02:00
parent 13314f23ba
commit 074ef7ce4e
3 changed files with 8 additions and 2 deletions
@@ -57,7 +57,7 @@
<h6 ng-hide="ctrl.results.length">No dashboards matching your query were found.</h6>
<div bindonce ng-repeat="row in ctrl.results">
<a class="search-item pointer search-item-{{row.type}}"
<a class="search-item pointer search-item-{{row.type}} search-results-{{ctrl.searchMode}}-mode"
ng-class="{'selected': $index == ctrl.selectedIndex}" ng-href="{{row.url}}">
<span class="search-result-tags">
@@ -20,6 +20,7 @@ export class SearchCtrl {
ignoreClose: any;
// triggers fade animation class
openCompleted: boolean;
searchMode = 'browse';
/** @ngInject */
constructor(private $scope, private $location, private $timeout, private backendSrv, private contextSrv, private $rootScope) {
@@ -105,6 +106,7 @@ export class SearchCtrl {
var localSearchId = this.currentSearchId;
this.query.browseMode = this.queryHasNoFilters();
this.searchMode = this.queryHasNoFilters() ? 'browse': 'search';
return this.backendSrv.search(this.query).then((results) => {
if (localSearchId < this.currentSearchId) { return; }
+5 -1
View File
@@ -146,10 +146,14 @@
content: "\f015";
}
.search-item-dash-folder > .search-result-link > .search-result-icon::before {
.search-item-dash-folder.search-results-browse-mode > .search-result-link > .search-result-icon::before {
content: "\f07c";
}
.search-item-dash-folder.search-results-search-mode > .search-result-link > .search-result-icon::before {
content: "\f07b";
}
.search-button-row {
padding: $spacer*2;
display: flex;