Commit 074ef7ce by Daniel Lee

WIP: add open/closed folders icons for dash search

If browsing, then show open folder icon. If searching, show
the closed folder icon
parent 13314f23
......@@ -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; }
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment